Handle lost bar position by reverting to 50%, same as too close to edge

This commit is contained in:
Nathan Gray 2014-02-12 22:51:55 +00:00
parent f0d7751496
commit 614736e4e3

View File

@ -285,7 +285,7 @@ var splitterCounter = 0;
var pw = opts.dockPane[0][opts.pxSplit]; var pw = opts.dockPane[0][opts.pxSplit];
if ( pw ) return; if ( pw ) return;
// 20px away is too close, reset to 50% // 20px away is too close, reset to 50%
if(Math.abs(bar._pos - splitter._DA - bar._DA) < 20) bar._pos = splitter._DA / 2; if(bar._pos == null || Math.abs(bar._pos - splitter._DA - bar._DA) < 20) bar._pos = splitter._DA / 2;
var x={}; x[opts.origin]=bar._pos+"px"; var x={}; x[opts.origin]=bar._pos+"px";
bar.removeClass(opts.barDockedClass) bar.removeClass(opts.barDockedClass)
.animate(x, opts.undockSpeed||opts.dockSpeed||1, opts.undockEasing||opts.dockEasing, function(){ .animate(x, opts.undockSpeed||opts.dockSpeed||1, opts.undockEasing||opts.dockEasing, function(){