mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-30 19:00:09 +00:00 
			
		
		
		
	some cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									45be21d9ce
								
							
						
					
					
						commit
						5e23120e87
					
				| @ -260,28 +260,15 @@ function makePanel(title, parent, open, keep_empty, close_button){ | |||||||
| 			// - create a new panel when dropping outside of curent panel...
 | 			// - create a new panel when dropping outside of curent panel...
 | ||||||
| 			// - remove empty panels...
 | 			// - remove empty panels...
 | ||||||
| 			beforeStop: function(e, ui){ | 			beforeStop: function(e, ui){ | ||||||
| 				//var c = 0
 |  | ||||||
| 
 |  | ||||||
| 				// do this only when dropping outside the panel...
 | 				// do this only when dropping outside the panel...
 | ||||||
| 				//if(ui.placeholder.css('display') == 'none'
 |  | ||||||
| 				if(ui.item.data('isoutside') | 				if(ui.item.data('isoutside') | ||||||
| 						// prevent draggingout the last panel...
 | 						// prevent draggingout the last panel...
 | ||||||
| 						// NOTE: 2 because we are taking into account 
 | 						// NOTE: 2 because we are taking into account 
 | ||||||
| 						// 		the placeholders...
 | 						// 		the placeholders...
 | ||||||
| 						&& panel.find('.sub-panel').length > 2){ | 						&& panel.find('.sub-panel').length > 2){ | ||||||
| 					// compensate for removed item which is still in the
 |  | ||||||
| 					// panel when we count it...
 |  | ||||||
| 					// ...this is likely to the fact that we jquery-ui did
 |  | ||||||
| 					// not cleanup yet
 |  | ||||||
| 					//c = 1
 |  | ||||||
| 					wrapWithPanel(ui.item, panel.parent(), ui.offset) | 					wrapWithPanel(ui.item, panel.parent(), ui.offset) | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 				// remove the panel when it runs out of sub-panels...
 |  | ||||||
| 				//if(!keep_empty && panel.find('.sub-panel').length-c <= 0){
 |  | ||||||
| 				//	removePanel(panel, true)
 |  | ||||||
| 				//}
 |  | ||||||
| 
 |  | ||||||
| 				panel.trigger('subPanelRemoved') | 				panel.trigger('subPanelRemoved') | ||||||
| 
 | 
 | ||||||
| 				_resetSidePanels() | 				_resetSidePanels() | ||||||
| @ -419,9 +406,7 @@ function makeSubPanel(title, content, parent, open, content_resizable, close_but | |||||||
| 					.click(function(){ | 					.click(function(){ | ||||||
| 						var parent = sub_panel.parents('.panel').first() | 						var parent = sub_panel.parents('.panel').first() | ||||||
| 						removePanel(sub_panel) | 						removePanel(sub_panel) | ||||||
| 						// XXX need to notify the parent...
 | 						// notify the parent panel of removal...
 | ||||||
| 						// 		...so as to enable it to remove itself 
 |  | ||||||
| 						// 		if no sub-panels left...
 |  | ||||||
| 						parent.trigger('subPanelRemoved') | 						parent.trigger('subPanelRemoved') | ||||||
| 						return false | 						return false | ||||||
| 					}) | 					}) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user