Universal in page modal object/element
$ component install chameleonui/modal
Creates new Modal object attached to el
with optional options.
Options has following default values:
var defaults = {
template: "<div class='modal is-hidden'></div>",
method: 'after',
className: 'modal',
classHidden: 'is-hidden',
eventName: 'chameleonui-modal',
ajaxErrorMsg: 'Server communication error!'
};
Public properties:
Modal.id; // Unique ID used for HTML element
Modal.isPlaced; // DOM placement state
Modal.isVisible; // visibility state
Sets DoT template of Modal.
Place Modalt into DOM – hidden by default.
Remove hide and remove modal form DOM.
Show modal to all.
Hides modal - but it is stil in DOM.
Toggle modal visibility – does not manipulate DOM.
Replace content if Modal already placed.
Replace content by AJAX response if Modal already placed.
type
– HTTP request method GET/POST… etc.- be aware XHR needs CORS and HTTP OPTIONS enabled
cache
– use cache for XHR on not – default:true
Edgedesign s.r.o. – Tomas Kuba
MIT