Bug 493978 - Disable tab-detach when the tab is dropped very close to the tabbar (also fixes bug 494026). r=dietrich. a=beltzner.

This commit is contained in:
Asaf Romano 2009-05-21 04:53:53 +03:00
parent 9159839164
commit 5b82eb810a
2 changed files with 5 additions and 2 deletions

View File

@ -2794,6 +2794,7 @@ var newWindowButtonObserver = {
flavourSet.appendFlavour("text/unicode");
flavourSet.appendFlavour("text/x-moz-url");
flavourSet.appendFlavour("application/x-moz-file", "nsIFile");
flavourSet.appendFlavour("text/x-moz-text-internal"); // for tabs
return flavourSet;
}
}

View File

@ -2266,9 +2266,11 @@
// check if the drop point is horizontally within the window
if (eX > wX && eX < (wX + window.outerWidth)) {
var bo = this.mTabContainer.mTabstrip.boxObject;
var tabbarEndScreenY = bo.screenY + bo.height;
// also avoid detaching if the the tab was dropped too close to
// the tabbar (half a tab)
var endScreenY = bo.screenY + 1.5 * bo.height;
var eY = aEvent.screenY;
if (eY < tabbarEndScreenY && eY > window.screenY)
if (eY < endScreenY && eY > window.screenY)
return;
}