mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-12-17 00:31:40 +00:00
now event.source is set to browser instance when triggering events via the browser widget...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
5f387eda31
commit
8dbd4b2f27
@ -13,6 +13,7 @@ var object = require('../object')
|
||||
|
||||
|
||||
/*********************************************************************/
|
||||
// helpers...
|
||||
|
||||
function proxyToDom(name){
|
||||
return function(){
|
||||
@ -166,11 +167,34 @@ var BrowserPrototype = {
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
// Trigger jQuery events on Browser...
|
||||
//
|
||||
// This will pass the browser instance to .source attribute of the
|
||||
// event object triggered.
|
||||
trigger: function(){
|
||||
var args = args2array(arguments)
|
||||
var evt = args.shift()
|
||||
|
||||
if(typeof(evt) == typeof('str')){
|
||||
evt = {
|
||||
type: evt,
|
||||
source: this,
|
||||
}
|
||||
} else {
|
||||
evt.source = this
|
||||
}
|
||||
|
||||
args.splice(0, 0, evt)
|
||||
|
||||
this.dom.trigger.apply(this.dom, args)
|
||||
return this
|
||||
},
|
||||
|
||||
// proxy event api...
|
||||
on: proxyToDom('on'),
|
||||
one: proxyToDom('one'),
|
||||
off: proxyToDom('off'),
|
||||
trigger: proxyToDom('trigger'),
|
||||
bind: proxyToDom('bind'),
|
||||
unbind: proxyToDom('unbind'),
|
||||
deligate: proxyToDom('deligate'),
|
||||
@ -651,6 +675,9 @@ var BrowserPrototype = {
|
||||
// NOTE: 'none' will always return an empty jQuery object, to get
|
||||
// the selection state before deselecting use .select('!')
|
||||
// NOTE: this uses .filter(..) for string and regexp matching...
|
||||
//
|
||||
// XXX should the select event also contain path info???
|
||||
// (also see: event api proxy)
|
||||
select: function(elem, filtering){
|
||||
var pattern = '.list div:not(.disabled):not(.filtered-out)'
|
||||
var browser = this.dom
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user