Is it possible add event handler for dynamic modal (alert, confirm, prompt)?
i found solution:
please update from this:
UI.modal.alert = function(content, options) {
UI.modal.dialog(([
'<a class="uk-close uk-modal-close"></a>',
'<div class="uk-margin uk-modal-content">'+String(content)+'</div>',
'<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-button-primary uk-modal-close">Ok</button></div>'
]).join(""), UI.$.extend({bgclose:false, keyboard:false}, options)).show();
};
to this:
UI.modal.alert = function(content, options) {
var modal = UI.modal.dialog(([
'<a class="uk-close uk-modal-close"></a>',
'<div class="uk-margin uk-modal-content">'+String(content)+'</div>',
'<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-button-primary uk-modal-close">Ok</button></div>'
]).join(""), UI.$.extend({bgclose:false, keyboard:false}, options)).show();
return modal;
};
and was possible use closure:
UIkit.modal.alert("your text", {center: true}).on('hide.uk.modal', function() {
// custome js code
});
Most helpful comment
i found solution:
please update from this:
to this:
and was possible use closure: