mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-11-04 13:20:10 +00:00 
			
		
		
		
	now actions.on(..) support event arrays...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									6c9c0c779b
								
							
						
					
					
						commit
						ac03e40193
					
				@ -363,8 +363,10 @@ module.MetaActions = {
 | 
			
		||||
		var handler = typeof(c) == 'function' ? c : b
 | 
			
		||||
		var tag = typeof(c) == 'function' ? b : c
 | 
			
		||||
 | 
			
		||||
		actions = typeof(actions) == 'string' ? actions.split(' ') : actions
 | 
			
		||||
 | 
			
		||||
		var that = this
 | 
			
		||||
		actions.split(' ').forEach(function(action){
 | 
			
		||||
		actions.forEach(function(action){
 | 
			
		||||
			// prepare the handler...
 | 
			
		||||
			var mode = action.split('.')
 | 
			
		||||
			action = mode[0]
 | 
			
		||||
@ -406,13 +408,13 @@ module.MetaActions = {
 | 
			
		||||
	// Remove an action callback...
 | 
			
		||||
	//
 | 
			
		||||
	// XXX needs more testing...
 | 
			
		||||
	off: function(action, handler){
 | 
			
		||||
	off: function(actions, handler){
 | 
			
		||||
		if(this.hasOwnProperty('_action_handlers')){
 | 
			
		||||
			if(action == '*'){
 | 
			
		||||
				var actions = Object.keys(this._action_handlers)
 | 
			
		||||
			} else {
 | 
			
		||||
				var actions = action.split(' ')
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			actions = actions == '*' ? Object.keys(this._action_handlers)
 | 
			
		||||
				: typeof(actions) == 'string' ?  action.split(' ')
 | 
			
		||||
				: actions
 | 
			
		||||
 | 
			
		||||
			var that = this
 | 
			
		||||
			actions.forEach(function(action){
 | 
			
		||||
				var mode = action.split('.')
 | 
			
		||||
@ -455,6 +457,16 @@ module.MetaActions = {
 | 
			
		||||
		}
 | 
			
		||||
		return this
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	// NOTE: if 'all' is set them mixin all the actions available, 
 | 
			
		||||
	// 		otherwise only mixin local actions...
 | 
			
		||||
	mixin: function(from, all){
 | 
			
		||||
		// XXX link actions from 'from' into this...
 | 
			
		||||
	},
 | 
			
		||||
	mixinto: function(to, all){
 | 
			
		||||
		return this.mixin.call(to, this, all)
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user