mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-11-04 13:20:10 +00:00 
			
		
		
		
	added deselect event...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									7d5c38de96
								
							
						
					
					
						commit
						898fab432b
					
				@ -601,9 +601,6 @@ var BrowserPrototype = {
 | 
				
			|||||||
	// NOTE: 'none' will always return an empty jQuery object, to get 
 | 
						// NOTE: 'none' will always return an empty jQuery object, to get 
 | 
				
			||||||
	// 		the selection state before deselecting use .select('!')
 | 
						// 		the selection state before deselecting use .select('!')
 | 
				
			||||||
	// NOTE: this uses .filter(..) for string and regexp matching...
 | 
						// NOTE: this uses .filter(..) for string and regexp matching...
 | 
				
			||||||
	//
 | 
					 | 
				
			||||||
	//
 | 
					 | 
				
			||||||
	// XXX Q: should this trigger a "deselect" event???
 | 
					 | 
				
			||||||
	select: function(elem, filtering){
 | 
						select: function(elem, filtering){
 | 
				
			||||||
		var pattern = '.list div:not(.disabled):not(.filtered-out)'
 | 
							var pattern = '.list div:not(.disabled):not(.filtered-out)'
 | 
				
			||||||
		var browser = this.dom
 | 
							var browser = this.dom
 | 
				
			||||||
@ -643,9 +640,10 @@ var BrowserPrototype = {
 | 
				
			|||||||
			if(!filtering){
 | 
								if(!filtering){
 | 
				
			||||||
				browser.find('.path .dir.cur').empty()
 | 
									browser.find('.path .dir.cur').empty()
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			elems
 | 
								elems = elems
 | 
				
			||||||
				.filter('.selected')
 | 
									.filter('.selected')
 | 
				
			||||||
				.removeClass('selected')
 | 
									.removeClass('selected')
 | 
				
			||||||
 | 
								this.trigger('deselect', elems)
 | 
				
			||||||
			return $()
 | 
								return $()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// strict...
 | 
							// strict...
 | 
				
			||||||
@ -701,9 +699,11 @@ var BrowserPrototype = {
 | 
				
			|||||||
					p.scrollTop(S + t - D)
 | 
										p.scrollTop(S + t - D)
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									elem.addClass('selected')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				this.trigger('select', elem)
 | 
									this.trigger('select', elem)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				return elem.addClass('selected')
 | 
									return elem
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
@ -726,6 +726,7 @@ var BrowserPrototype = {
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Push an element to path / go down one level...
 | 
						// Push an element to path / go down one level...
 | 
				
			||||||
 | 
						// XXX trigger a "push" event... (???)
 | 
				
			||||||
	push: function(elem){
 | 
						push: function(elem){
 | 
				
			||||||
		var browser = this.dom 
 | 
							var browser = this.dom 
 | 
				
			||||||
		var elem = this.select(elem || '!')
 | 
							var elem = this.select(elem || '!')
 | 
				
			||||||
@ -751,6 +752,7 @@ var BrowserPrototype = {
 | 
				
			|||||||
		return this
 | 
							return this
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	// Pop an element off the path / go up one level...
 | 
						// Pop an element off the path / go up one level...
 | 
				
			||||||
 | 
						// XXX trigger a "pop" event... (???)
 | 
				
			||||||
	pop: function(){
 | 
						pop: function(){
 | 
				
			||||||
		var browser = this.dom
 | 
							var browser = this.dom
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -771,7 +773,6 @@ var BrowserPrototype = {
 | 
				
			|||||||
	// XXX think about the API...
 | 
						// XXX think about the API...
 | 
				
			||||||
	// XXX need to check if openable i.e. when to use open and when push...
 | 
						// XXX need to check if openable i.e. when to use open and when push...
 | 
				
			||||||
	// XXX might be a good idea to add a live traversable check...
 | 
						// XXX might be a good idea to add a live traversable check...
 | 
				
			||||||
	// XXX trigger an "open" event...
 | 
					 | 
				
			||||||
	action: function(){
 | 
						action: function(){
 | 
				
			||||||
		var elem = this.select('!')
 | 
							var elem = this.select('!')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -840,7 +841,7 @@ var BrowserPrototype = {
 | 
				
			|||||||
	},
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// XXX need to get a container -- UI widget API....
 | 
						// XXX need to get a container -- UI widget API....
 | 
				
			||||||
	// XXX setup instance events...
 | 
						// XXX trigger started event...
 | 
				
			||||||
	__init__: function(parent, options){
 | 
						__init__: function(parent, options){
 | 
				
			||||||
		options = options || {}
 | 
							options = options || {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user