The following examples present common usages of the coins-jquery-ui-utility library.
Learn more »
Common bootstrappy buttons. Note how an `el` is passed. Without an `el`, just the configuration object is returned.
// with `el`
jquu.button.base({class: 'default', el: document.getElementById('button-b1') });
jquu.button.base({class: 'danger', el: document.getElementById('button-b2') });
jquu.button.base({class: 'info', el: document.getElementById('button-b3') });
jquu.button.base({class: 'primary', el: document.getElementById('button-b4') });
jquu.button.base({class: 'success', el: document.getElementById('button-b5') });
jquu.button.base({class: 'warning', el: document.getElementById('button-b6') });
// with no `el`
jquu.button.base({class: 'default'});
{ "class": "btn-default button-default ui-button-default", "click": function () {...} }
Predefined common dialogs are ready to go. Shebam!
// Default dialog, with close. errors without body
jquu.dialog.base({body: 'test'});
// Fail dialog, with close. errors without body
jquu.dialog.fail({body: 'bummer'});
// Extend dialog buttons
jquu.dialog.fail({body: 'bummer', title: 'custom title', buttons: [ jquu.button.base({class: 'success', text: 'button'}) ]});