Bug 574702: avoid initializing WindowDraggingUtils multiple times due to binding re-attachment (causes dragging jumpiness issues), r=enndeakin

This commit is contained in:
Felipe Gomes 2010-06-25 16:06:36 -04:00
parent 013e10d651
commit e358a123e2
2 changed files with 25 additions and 16 deletions

View File

@ -161,10 +161,13 @@
extends="chrome://global/content/bindings/general.xml#statusbar">
<implementation>
<constructor>
if (!this._draggableStarted) {
this._draggableStarted = true;
try {
Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm");
new WindowDraggingElement(this, window);
} catch (e) {}
}
</constructor>
</implementation>
</binding>
@ -262,10 +265,13 @@
<binding id="windowdragbox">
<implementation>
<constructor>
if (!this._draggableStarted) {
this._draggableStarted = true;
try {
Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm");
new WindowDraggingElement(this, window);
} catch (e) {}
}
</constructor>
</implementation>
</binding>

View File

@ -441,6 +441,8 @@
extends="chrome://global/content/bindings/toolbar.xml#toolbar">
<implementation>
<constructor><![CDATA[
if (!this._draggableStarted) {
this._draggableStarted = true;
try {
Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm");
let draggableThis = new WindowDraggingElement(this, window);
@ -449,6 +451,7 @@
return !this.parentNode.customizing && !window.fullScreen;
}
} catch (e) {}
}
]]></constructor>
</implementation>
</binding>