Bug 626863 Sidebars don't snap when panning iframes r=mfinkle

This commit is contained in:
Benjamin Stover 2011-01-18 16:20:15 -08:00
parent 310e52cf3c
commit 2b44ffc216
2 changed files with 8 additions and 9 deletions

View File

@ -434,7 +434,7 @@
</body>
</method>
<method name="getViewsAt">
<method name="getViewAt">
<body>
<![CDATA[
return this._contentView;
@ -760,8 +760,6 @@
this._updateCacheViewport();
}
this._contentView = null;
// We expect contentViews to contain our ID. If not, something bad
// happened.
delete this.self._contentViews[this._id];
@ -921,7 +919,7 @@
</method>
<!-- Get contentView for position (x, y) relative to the browser element -->
<method name="getViewsAt">
<method name="getViewAt">
<parameter name="x"/>
<parameter name="y"/>
<body>

View File

@ -1169,10 +1169,11 @@ Browser.MainDragger.prototype = {
dragStart: function dragStart(clientX, clientY, target, scroller) {
let browser = getBrowser();
let bcr = browser.getBoundingClientRect();
this._contentView = browser.getViewsAt(clientX - bcr.left, clientY - bcr.top);
this._contentView = browser.getViewAt(clientX - bcr.left, clientY - bcr.top);
},
dragStop: function dragStop(dx, dy, scroller) {
this._contentView = null;
this.dragMove(Browser.snapSidebars(), 0, scroller);
Browser.tryUnfloatToolbar();
},
@ -1180,15 +1181,15 @@ Browser.MainDragger.prototype = {
dragMove: function dragMove(dx, dy, scroller) {
let doffset = new Point(dx, dy);
if (!this._contentView.isRoot()) {
// First calculate any panning to take sidebars out of view
let panOffset = this._panControlsAwayOffset(doffset);
if (this._contentView && !this._contentView.isRoot()) {
this._panContentView(this._contentView, doffset);
// XXX we may need to have "escape borders" for iframe panning
// XXX does not deal with scrollables within scrollables
}
// First calculate any panning to take sidebars out of view
let panOffset = this._panControlsAwayOffset(doffset);
// Do content panning
this._panContentView(getBrowser().getRootView(), doffset);