mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-14 19:42:49 +00:00
Added files
This commit is contained in:
23
mongoui/mongoui-master/node_modules/derby-ui-boot/modal/index.js
generated
vendored
Normal file
23
mongoui/mongoui-master/node_modules/derby-ui-boot/modal/index.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
exports.create = function(model, dom) {
|
||||
var self = this;
|
||||
|
||||
dom.addListener(document, 'keydown', function(e) {
|
||||
if (e.keyCode === 27) { // Escape
|
||||
self.close('escape')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
exports.show = function() {
|
||||
this.model.set('show', true)
|
||||
}
|
||||
|
||||
exports.close = function(action) {
|
||||
var cancelled = this.emitCancellable('close', action)
|
||||
if (!cancelled) this.model.set('show', false)
|
||||
}
|
||||
|
||||
exports._click = function(e) {
|
||||
var action = e.target.getAttribute('data-action')
|
||||
if (action) this.close(action)
|
||||
}
|
||||
Reference in New Issue
Block a user