mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
e896cc0640
commit
2479cde562
@ -134,6 +134,7 @@ requirejs([
|
|||||||
make('aaa')
|
make('aaa')
|
||||||
make.nest('D', browser.Browser(function(make){
|
make.nest('D', browser.Browser(function(make){
|
||||||
make('a')
|
make('a')
|
||||||
|
make('---')
|
||||||
make('b')
|
make('b')
|
||||||
}))
|
}))
|
||||||
make('bbb')
|
make('bbb')
|
||||||
|
|||||||
@ -201,7 +201,10 @@ var makeEventMethod = function(event, handler){
|
|||||||
// XXX can we generate this in one spot???
|
// XXX can we generate this in one spot???
|
||||||
// ...currently it is generated here and in .trigger(..)
|
// ...currently it is generated here and in .trigger(..)
|
||||||
var evt = {
|
var evt = {
|
||||||
name: event,
|
name: event,
|
||||||
|
// XXX
|
||||||
|
//stopPropagation: function(){
|
||||||
|
//},
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX handle more of the API???
|
// XXX handle more of the API???
|
||||||
@ -253,6 +256,7 @@ var BaseBrowserPrototype = {
|
|||||||
noDuplicateValues: false,
|
noDuplicateValues: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// XXX needed to bubble the events up...
|
||||||
parent: null,
|
parent: null,
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -510,6 +514,10 @@ var BaseBrowserPrototype = {
|
|||||||
parent: this,
|
parent: this,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// XXX do we need both this and the above ref???
|
||||||
|
item.sublist instanceof Browser
|
||||||
|
&& (item.sublist.parent = this)
|
||||||
|
|
||||||
// store the item...
|
// store the item...
|
||||||
items.push(item)
|
items.push(item)
|
||||||
new_index[key] = item
|
new_index[key] = item
|
||||||
@ -779,20 +787,29 @@ var BaseBrowserPrototype = {
|
|||||||
},
|
},
|
||||||
trigger: function(evt, ...args){
|
trigger: function(evt, ...args){
|
||||||
var that = this
|
var that = this
|
||||||
|
var stopPropagation = false
|
||||||
var evt = typeof(evt) == typeof('str') ?
|
var evt = typeof(evt) == typeof('str') ?
|
||||||
// XXX construct this in one place...
|
// XXX construct this in one place...
|
||||||
// ...currently it is constructed here and in makeEventMethod(..)
|
// ...currently it is constructed here and in makeEventMethod(..)
|
||||||
{
|
{
|
||||||
name: evt,
|
name: evt,
|
||||||
|
stopPropagation: function(){
|
||||||
|
stopPropagation = true },
|
||||||
}
|
}
|
||||||
: evt
|
: evt
|
||||||
|
|
||||||
|
// call the main set of handlers...
|
||||||
;((this.__event_handlers || {})[evt.name] || [])
|
;((this.__event_handlers || {})[evt.name] || [])
|
||||||
// prevent .off(..) from affecting the call loop...
|
// prevent .off(..) from affecting the call loop...
|
||||||
.slice()
|
.slice()
|
||||||
.forEach(function(handler){
|
.forEach(function(handler){
|
||||||
handler.call(that, evt, ...args) })
|
handler.call(that, evt, ...args) })
|
||||||
// XXX should we trigger the parent event????
|
|
||||||
//this.parent.trigger(evt, ...args)
|
// trigger the parent's event...
|
||||||
|
!stopPropagation
|
||||||
|
&& this.parent
|
||||||
|
&& this.parent.trigger(evt, ...args)
|
||||||
|
|
||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user