mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
now panels are hidden rather than removed (optional mode switch exists but commented out)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
06ac2d63c4
commit
837ee9120f
@ -36,6 +36,14 @@ var PANELS = {}
|
|||||||
var PANEL_STATE = {}
|
var PANEL_STATE = {}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
// This can be:
|
||||||
|
// - hide
|
||||||
|
// - remove
|
||||||
|
var PANEL_CLOSE_METHOD = 'hide'
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Helpers...
|
* Helpers...
|
||||||
@ -158,7 +166,7 @@ function makePanel(title, parent, open, keep_empty, close_button){
|
|||||||
// be accessed from different contexts...
|
// be accessed from different contexts...
|
||||||
.on('subPanelsUpdated', function(){
|
.on('subPanelsUpdated', function(){
|
||||||
// remove the panel when it runs out of sub-panels...
|
// remove the panel when it runs out of sub-panels...
|
||||||
if(!keep_empty && panel.find('.sub-panel').length <= 0){
|
if(!keep_empty && panel.find('.sub-panel:visible').length <= 0){
|
||||||
removePanel(panel, true)
|
removePanel(panel, true)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -444,8 +452,10 @@ function openPanel(panel){
|
|||||||
open = isPanelVisible(panel)
|
open = isPanelVisible(panel)
|
||||||
// show panels...
|
// show panels...
|
||||||
panel
|
panel
|
||||||
|
.css('display', '')
|
||||||
.prop('open', true)
|
.prop('open', true)
|
||||||
.parents('.panel')
|
.parents('.panel')
|
||||||
|
.css('display', '')
|
||||||
.prop('open', true)
|
.prop('open', true)
|
||||||
// show side panels...
|
// show side panels...
|
||||||
panel
|
panel
|
||||||
@ -481,7 +491,7 @@ function closePanel(panel){
|
|||||||
panel = typeof(panel) == typeof('str')
|
panel = typeof(panel) == typeof('str')
|
||||||
? getPanel(panel)
|
? getPanel(panel)
|
||||||
: panel
|
: panel
|
||||||
panel.find('.sub-panel').each(function(){
|
panel.find('.sub-panel:visible').each(function(){
|
||||||
var p = $(this)
|
var p = $(this)
|
||||||
if(p.prop('open')){
|
if(p.prop('open')){
|
||||||
p.trigger('panelClosing', p)
|
p.trigger('panelClosing', p)
|
||||||
@ -500,8 +510,17 @@ function removePanel(panel){
|
|||||||
panel = typeof(panel) == typeof('str')
|
panel = typeof(panel) == typeof('str')
|
||||||
? getPanel(panel)
|
? getPanel(panel)
|
||||||
: panel
|
: panel
|
||||||
|
/*
|
||||||
|
if(PANEL_CLOSE_METHOD == 'hide'){
|
||||||
|
return closePanel(panel)
|
||||||
|
.hide()
|
||||||
|
} else {
|
||||||
|
return closePanel(panel)
|
||||||
|
.remove()
|
||||||
|
}
|
||||||
|
*/
|
||||||
return closePanel(panel)
|
return closePanel(panel)
|
||||||
.remove()
|
.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user