downgraded jquery-ui to 1.9.1, fixed most of the panel bugs...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-12-23 03:43:21 +04:00
parent 3bb475de0c
commit d211857b08
4 changed files with 55 additions and 14 deletions

View File

@ -2,6 +2,22 @@
<link rel="stylesheet" type="text/css" href="../css/editor.css">
<style>
.docked-panels {
background: gray;
width: 100%;
height: 100%;
}
.viewer {
background: white;
width: 100%;
height: 100%;
}
</style>
<script src="../ext-lib/jquery.js"></script>
<script src="../ext-lib/jquery-ui.js"></script>
<script src="../lib/panels.js"></script>
@ -12,6 +28,10 @@
$(function(){
var panel = makePanel('Test Panel A', true)
.css({
top: 50,
left: 50,
})
makeSubPanel('Test Sub Panel A', true, panel)
@ -26,11 +46,20 @@ $(function(){
.find('.content')
.html('<h3>Panel C</h3>')
/*
$('.docked-panels')
.sortable({
cancel: '.viewer',
connectWith: '.panel-content',
})
*/
$('body')
.append(panel)
//.append(makePanel('Test Panel B', true))
//.append(makePanel('Test Panel C', true))
})
@ -38,6 +67,11 @@ $(function(){
<body>
<div class="docked-panels panel-content">
<div class="viewer">
</div>
</div>
</body>
</html>
<!-- vim:set ts=4 sw=4 : -->

File diff suppressed because one or more lines are too long

View File

@ -50,19 +50,31 @@ function makePanel(title, open, editable_title, keep_empty){
forcePlaceholderSize: true,
opacity: 0.7,
connectWith: '.panel-content',
zIndex: 9999,
start: function(e, ui){
console.log('start')
ui.item.data('isoutside', false)
ui.placeholder.height(ui.helper.outerHeight());
ui.placeholder.width(ui.helper.outerWidth());
},
// create a new panel when dropping outside of curent panel...
beforeStop: function(e, ui){
console.log('stop')
var c = 0
// do this only when dropping outside the panel...
if(ui.item.data('isoutside')){
if(ui.item.data('isoutside')
// prevent draggingout the last panel...
// NOTE: 2 because we are taking into account
// the placeholders...
&& panel.find('.sub-panel').length > 2){
c = 1
// 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
var new_panel = makePanel()
// XXX adjust this to scale...
// XXX adjust this to parent offset...
.css(ui.offset)
.appendTo(panel.parent())
new_panel.find('.panel-content')
@ -71,7 +83,7 @@ function makePanel(title, open, editable_title, keep_empty){
}
// 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').length-c <= 0){
panel
.trigger('panelClosing')
.remove()
@ -79,15 +91,10 @@ function makePanel(title, open, editable_title, keep_empty){
ui.item.data('isoutside', false)
},
receive: function(e, ui){
console.log('receive')
ui.item.data('isoutside', false)
},
over: function(e, ui){
console.log('over')
ui.item.data('isoutside', false)
},
// XXX this is triggered when the sorted object is dropped...
out: function(e, ui){
console.log('out')
ui.item.data('isoutside', true)

View File

@ -486,6 +486,7 @@ function setupTags(viewer){
return viewer
.on('imagesLoaded', function(){
// XXX need to detect if tags have been loaded...
TAGS = {}
showStatusQ('Tags: Index: building...')
@ -498,7 +499,7 @@ function setupTags(viewer){
showStatusQ('Tags: Index: done ('+( t1 - t0 )+'ms).')
})
}
SETUP_BINDINGS.push(setupTags)
//SETUP_BINDINGS.push(setupTags)
// Setup the unsorted image state managers...