openmedialibrary/static/js/confirmDialog.js

23 lines
576 B
JavaScript
Raw Normal View History

2014-05-04 17:26:43 +00:00
'use strict';
oml.ui.confirmDialog = function(options, callback) {
options = Ox.extend(options, {
buttons: options.buttons.map(function($button, index) {
return $button
.options({id: index ? 'yes' : 'no'})
.bindEvent({
click: function() {
that.close();
index && callback();
}
});
}),
keys: {enter: 'yes', escape: 'no'}
});
var that = oml.ui.iconDialog(options);
return that.open();
}