more cleanup and refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-04-30 20:14:39 +03:00
parent 1560ce647b
commit bf66b217c2
4 changed files with 22 additions and 9 deletions

View File

@ -315,8 +315,14 @@ module.makeUIContainer = function(make){
return uiContainer(function(){
var o = make.apply(this, arguments)
o
// notify the client that we are closing...
o.close(function(){ o.client.trigger('close') })
.close(function(){ o.client.trigger('close') })
.client
// NOTE: strictly this is the responsibility of the client
// but it is less error prone to just in case also do
// this here...
.on('close', function(evt){ evt.stopPropagation() })
return o
})

View File

@ -2155,10 +2155,6 @@ var BrowserPrototype = {
setTimeout(function(){
that.update(options.path || that.path || '/') }, 0)
if(this.options.nonPropagatedEvents != null){
this.on(this.options.nonPropagatedEvents.join(' '),
function(evt){ evt.stopPropagation() })
}
},
}

View File

@ -20,9 +20,6 @@ var DrawerClassPrototype = {
var that = this
var overlay = $('<div>')
.addClass('drawer-widget')
.on(options.nonPropagatedEvents.join(' '), function(){
event.stopPropagation()
})
.append($('<div>')
.addClass('content')
.click(function(){
@ -58,6 +55,8 @@ var DrawerPrototype = {
nonPropagatedEvents: [
'click',
'keydown',
'close',
],
background: null,

View File

@ -66,6 +66,8 @@ var WidgetPrototype = {
nonPropagatedEvents: [
'click',
'keydown',
'close',
],
},
@ -121,6 +123,11 @@ var WidgetPrototype = {
this))
}
if(this.options.nonPropagatedEvents != null){
this.on(this.options.nonPropagatedEvents.join(' '),
function(evt){ evt.stopPropagation() })
}
return this
},
}
@ -185,6 +192,11 @@ var ContainerPrototype = {
this))
}
if(this.options.nonPropagatedEvents != null){
this.on(this.options.nonPropagatedEvents.join(' '),
function(evt){ evt.stopPropagation() })
}
return this
},
}