subPanelRemoved is triggered on every sort and not only when panel is removed -- need to fix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-01-06 11:08:20 +04:00
parent 5e23120e87
commit 4fbfb5b554

View File

@ -26,8 +26,10 @@ var PANELS = {
// - start monitoring where we are dragged to...
// - open hidden side panels...
// XXX store number of panels we started with...
function _startSortHandler(e, ui){
ui.item.data('isoutside', false)
ui.item.data('sub-panels-before', $(this).find('.sub-panel').length)
ui.placeholder
.height(ui.helper.outerHeight())
.width(ui.helper.outerWidth())
@ -269,6 +271,14 @@ function makePanel(title, parent, open, keep_empty, close_button){
wrapWithPanel(ui.item, panel.parent(), ui.offset)
}
/* XXX this does not work right...
if(ui.item.data('sub-panels-before') < panel.find('.sub-panel').length){
console.log('!!!!')
panel.trigger('subPanelRemoved')
}
*/
// XXX need to trigger this ONLY of a panel was removed...
// ...check if number of panels changed...
panel.trigger('subPanelRemoved')
_resetSidePanels()