mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
cleanp and notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
11d4db7732
commit
f8244c51d6
@ -290,20 +290,12 @@ var callItemEventHandlers = function(item, event, evt, ...args){
|
|||||||
// NOTE: item is compatible to .search(item, ..) spec, see that for more
|
// NOTE: item is compatible to .search(item, ..) spec, see that for more
|
||||||
// details...
|
// details...
|
||||||
// NOTE: triggering an event that matches several items will handle each
|
// NOTE: triggering an event that matches several items will handle each
|
||||||
// item-parent chain individually, but not independently, i.e.:
|
// item-parent chain individually, and independently...
|
||||||
// - each chain gets the same event instance and thus calling
|
// NOTE: a parent that contains multiple items will get triggered multiple
|
||||||
// .stopPropagation() will stop all further propagation and
|
// times, once per each item...
|
||||||
// handling. (XXX is this correct?)
|
|
||||||
// - a parent that may contain multiple items will get triggered
|
|
||||||
// multiple times, once per each item...
|
|
||||||
// NOTE: item events do not directly trigger the original caller's handlers
|
// NOTE: item events do not directly trigger the original caller's handlers
|
||||||
// those will get celled recursively when the events are propagated
|
// those will get celled recursively when the events are propagated
|
||||||
// up the tree.
|
// up the tree.
|
||||||
//
|
|
||||||
// XXX should we have one event instance per call or one event per item matched???
|
|
||||||
// .stopPropagation() affects an event object thus creating one per item
|
|
||||||
// will make item call chains independent of each other, otherwise one
|
|
||||||
// call to .stopPropagation() will stop all chains...
|
|
||||||
var makeItemEventMethod = function(event, handler, options){
|
var makeItemEventMethod = function(event, handler, options){
|
||||||
options = Object.assign(
|
options = Object.assign(
|
||||||
// NOTE: we need to be able to pass item objects, so we can not
|
// NOTE: we need to be able to pass item objects, so we can not
|
||||||
@ -320,8 +312,6 @@ var makeItemEventMethod = function(event, handler, options){
|
|||||||
handler
|
handler
|
||||||
&& handler.call(this, evt, item.slice(), ...args)
|
&& handler.call(this, evt, item.slice(), ...args)
|
||||||
item.forEach(function(item){
|
item.forEach(function(item){
|
||||||
// XXX should we clone the event here???
|
|
||||||
//callItemEventHandlers(item, event, evt, ...args) }) },
|
|
||||||
// NOTE: we ignore the root event here and force each
|
// NOTE: we ignore the root event here and force each
|
||||||
// item chain to create it's own new event object...
|
// item chain to create it's own new event object...
|
||||||
// this will isolate each chain from the others in
|
// this will isolate each chain from the others in
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user