mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-01 03:40:09 +00:00
now panels auto-attach to parent -- still needs refining and testing...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
2da6b53a3a
commit
e6f3d6001f
@ -53,7 +53,12 @@ function toggleAutoHide(){
|
|||||||
|
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|
||||||
var panel = makePanel('Test Panel A', true)
|
PANEL_ROOT = 'body'
|
||||||
|
|
||||||
|
makeSidePanel('left')
|
||||||
|
makeSidePanel('right')
|
||||||
|
|
||||||
|
var panel = makePanel('Test Panel A')
|
||||||
.css({
|
.css({
|
||||||
top: 50,
|
top: 50,
|
||||||
left: 50,
|
left: 50,
|
||||||
@ -70,12 +75,7 @@ $(function(){
|
|||||||
|
|
||||||
makeSnapshotsPanel(panel, '.moo')
|
makeSnapshotsPanel(panel, '.moo')
|
||||||
|
|
||||||
|
makeSubPanel('Test Sub Panel D', $('<h2>Panel D</h2>'))
|
||||||
$('body')
|
|
||||||
.append(panel)
|
|
||||||
.append(makeSidePanel('left'))
|
|
||||||
.append(makeSidePanel('right'))
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -120,9 +120,10 @@ function closePanel(panel, skip_sub_panel_events){
|
|||||||
// either revert or create a new panel
|
// either revert or create a new panel
|
||||||
// does:
|
// does:
|
||||||
// drops to last placeholder
|
// drops to last placeholder
|
||||||
function makePanel(title, open, keep_empty, close_button){
|
function makePanel(title, parent, open, keep_empty, close_button){
|
||||||
title = title == null || title.trim() == '' ? ' ' : title
|
title = title == null || title.trim() == '' ? ' ' : title
|
||||||
close_button = close_button == null ? true : false
|
close_button = close_button == null ? true : false
|
||||||
|
parent = parent == null ? $(PANEL_ROOT) : parent
|
||||||
|
|
||||||
// the outer panel...
|
// the outer panel...
|
||||||
var panel = $('<details/>')
|
var panel = $('<details/>')
|
||||||
@ -210,6 +211,10 @@ function makePanel(title, open, keep_empty, close_button){
|
|||||||
})
|
})
|
||||||
.appendTo(panel)
|
.appendTo(panel)
|
||||||
|
|
||||||
|
if(parent != false){
|
||||||
|
panel.appendTo(parent)
|
||||||
|
}
|
||||||
|
|
||||||
return panel
|
return panel
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,8 +223,9 @@ function makePanel(title, open, keep_empty, close_button){
|
|||||||
// - left
|
// - left
|
||||||
// - right
|
// - right
|
||||||
// XXX in part this is exactly the same as makePanel
|
// XXX in part this is exactly the same as makePanel
|
||||||
function makeSidePanel(side, autohide){
|
function makeSidePanel(side, parent, autohide){
|
||||||
autohide = autohide == null ? 'on' : 'off'
|
autohide = autohide == null ? 'on' : 'off'
|
||||||
|
parent = parent == null ? $(PANEL_ROOT) : parent
|
||||||
var panel = $('.side-panel.'+side)
|
var panel = $('.side-panel.'+side)
|
||||||
// only one panel from each side can exist...
|
// only one panel from each side can exist...
|
||||||
if(panel.length != 0){
|
if(panel.length != 0){
|
||||||
@ -273,6 +279,10 @@ function makeSidePanel(side, autohide){
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if(parent != false){
|
||||||
|
panel.appendTo(parent)
|
||||||
|
}
|
||||||
|
|
||||||
return panel
|
return panel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user