Bug 631270: move status panel to the opposite side of the screen when the findbar is open, to avoid it obscuring find results in the common case of them being at the bottom left of the screen, r=gavin, ui-r=beltzner, a=beltzner

This commit is contained in:
Dão Gottwald 2011-03-02 16:48:58 -08:00
Родитель 4aef1c69f9
Коммит 454fe08769
2 изменённых файлов: 29 добавлений и 3 удалений

Просмотреть файл

@ -3750,11 +3750,23 @@
</xul:hbox> </xul:hbox>
</content> </content>
<implementation> <implementation implements="nsIDOMEventListener">
<constructor><![CDATA[
window.addEventListener("findbaropen", this, false);
]]></constructor>
<destructor><![CDATA[
window.removeEventListener("findbaropen", this, false);
]]></destructor>
<property name="label"> <property name="label">
<setter><![CDATA[ <setter><![CDATA[
if (!this.label) if (!this.label) {
if (window.gFindBarInitialized && !window.gFindBar.hidden)
this.setAttribute("mirror", "true");
else
this.removeAttribute("mirror"); this.removeAttribute("mirror");
}
this.style.minWidth = this.getAttribute("type") == "status" && this.style.minWidth = this.getAttribute("type") == "status" &&
this.getAttribute("previoustype") == "status" this.getAttribute("previoustype") == "status"
@ -3768,6 +3780,15 @@
</getter> </getter>
</property> </property>
<method name="handleEvent">
<parameter name="event"/>
<body><![CDATA[
if (event.type == "findbaropen" &&
this.label)
this.setAttribute("mirror", "true");
]]></body>
</method>
<method name="_mirror"> <method name="_mirror">
<body> <body>
if (this.hasAttribute("mirror")) if (this.hasAttribute("mirror"))

Просмотреть файл

@ -1142,6 +1142,11 @@
this.hidden = false; this.hidden = false;
this._updateStatusUI(this.nsITypeAheadFind.FIND_FOUND); this._updateStatusUI(this.nsITypeAheadFind.FIND_FOUND);
let event = document.createEvent("Events");
event.initEvent("findbaropen", true, false);
this.dispatchEvent(event);
return true; return true;
} }
return false; return false;