gd-sprest-js
Version:
SharePoint 2013/Online js components.
24 lines (23 loc) • 669 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var _1 = require(".");
/**
* Button
*/
exports.Button = function (props) {
// Add the button html
props.el.innerHTML = _1.Templates.Button(props);
// Get the button
var btn = props.el.firstElementChild;
// Set the button click event
btn.addEventListener("click", function (ev) {
// Disable postback
ev ? ev.preventDefault() : null;
// Execute the click event
props.onClick ? props.onClick(ev.currentTarget) : null;
});
// Create the button
var _btn = new _1.fabric.Button(btn);
// Return the button
return btn;
};