mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-02 04:10:11 +00:00
working on editor panels...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
2361dd4221
commit
5ec1089c56
@ -262,6 +262,7 @@ function makePanel(title, open, editable_title){
|
|||||||
.attr({
|
.attr({
|
||||||
contenteditable: editable_title == null ? 'false' : 'true',
|
contenteditable: editable_title == null ? 'false' : 'true',
|
||||||
})
|
})
|
||||||
|
// XXX add a '+' button to create a new panel...
|
||||||
.append($('<span/>')
|
.append($('<span/>')
|
||||||
.addClass('close-button')
|
.addClass('close-button')
|
||||||
.click(function(){
|
.click(function(){
|
||||||
@ -274,18 +275,45 @@ function makePanel(title, open, editable_title){
|
|||||||
.draggable({
|
.draggable({
|
||||||
containment: 'parent',
|
containment: 'parent',
|
||||||
scroll: false,
|
scroll: false,
|
||||||
|
// XXX this makes things quite a bit slower...
|
||||||
|
stack: '.panel',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
var _outside = false
|
||||||
|
|
||||||
// wrapper for sub-panels...
|
// wrapper for sub-panels...
|
||||||
var content = $('<span class="panel-content">')
|
var content = $('<span class="panel-content">')
|
||||||
.sortable({
|
.sortable({
|
||||||
forcePlaceholderSize: true,
|
forcePlaceholderSize: true,
|
||||||
|
opacity: 0.7,
|
||||||
|
connectWith: '.panel-content',
|
||||||
|
zIndex: 9999,
|
||||||
|
|
||||||
start: function(e, ui){
|
start: function(e, ui){
|
||||||
|
_outside = false
|
||||||
ui.placeholder.height(ui.helper.outerHeight());
|
ui.placeholder.height(ui.helper.outerHeight());
|
||||||
ui.placeholder.width(ui.helper.outerWidth());
|
ui.placeholder.width(ui.helper.outerWidth());
|
||||||
},
|
},
|
||||||
opacity: 0.7,
|
// XXX this is not done...
|
||||||
connectWith: '.panel-content',
|
// create a new panel when dropping outside of curent panel...
|
||||||
|
stop: function(e, ui){
|
||||||
|
// do this only when dropping putside the panel...
|
||||||
|
if(_outside){
|
||||||
|
makePanel()
|
||||||
|
// XXX adjust this to scale...
|
||||||
|
.css(ui.position)
|
||||||
|
.appendTo(panel.parent())
|
||||||
|
.find('.panel-content')
|
||||||
|
.append(ui.item)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// XXX are these the correct events???
|
||||||
|
over: function(e, ui){
|
||||||
|
_outside = false
|
||||||
|
},
|
||||||
|
out: function(e, ui){
|
||||||
|
_outside = true
|
||||||
|
},
|
||||||
})
|
})
|
||||||
.appendTo(panel)
|
.appendTo(panel)
|
||||||
return panel
|
return panel
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user