mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-12-16 16:21:40 +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(){
|
||||
|
||||
var panel = makePanel('Test Panel A', true)
|
||||
PANEL_ROOT = 'body'
|
||||
|
||||
makeSidePanel('left')
|
||||
makeSidePanel('right')
|
||||
|
||||
var panel = makePanel('Test Panel A')
|
||||
.css({
|
||||
top: 50,
|
||||
left: 50,
|
||||
@ -70,12 +75,7 @@ $(function(){
|
||||
|
||||
makeSnapshotsPanel(panel, '.moo')
|
||||
|
||||
|
||||
$('body')
|
||||
.append(panel)
|
||||
.append(makeSidePanel('left'))
|
||||
.append(makeSidePanel('right'))
|
||||
|
||||
makeSubPanel('Test Sub Panel D', $('<h2>Panel D</h2>'))
|
||||
|
||||
})
|
||||
|
||||
|
||||
@ -120,9 +120,10 @@ function closePanel(panel, skip_sub_panel_events){
|
||||
// either revert or create a new panel
|
||||
// does:
|
||||
// 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
|
||||
close_button = close_button == null ? true : false
|
||||
parent = parent == null ? $(PANEL_ROOT) : parent
|
||||
|
||||
// the outer panel...
|
||||
var panel = $('<details/>')
|
||||
@ -210,6 +211,10 @@ function makePanel(title, open, keep_empty, close_button){
|
||||
})
|
||||
.appendTo(panel)
|
||||
|
||||
if(parent != false){
|
||||
panel.appendTo(parent)
|
||||
}
|
||||
|
||||
return panel
|
||||
}
|
||||
|
||||
@ -218,8 +223,9 @@ function makePanel(title, open, keep_empty, close_button){
|
||||
// - left
|
||||
// - right
|
||||
// XXX in part this is exactly the same as makePanel
|
||||
function makeSidePanel(side, autohide){
|
||||
function makeSidePanel(side, parent, autohide){
|
||||
autohide = autohide == null ? 'on' : 'off'
|
||||
parent = parent == null ? $(PANEL_ROOT) : parent
|
||||
var panel = $('.side-panel.'+side)
|
||||
// only one panel from each side can exist...
|
||||
if(panel.length != 0){
|
||||
@ -273,6 +279,10 @@ function makeSidePanel(side, autohide){
|
||||
},
|
||||
})
|
||||
|
||||
if(parent != false){
|
||||
panel.appendTo(parent)
|
||||
}
|
||||
|
||||
return panel
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user