Bug 879631 - Change - Remove form navigation code. r=mbrubeck

This commit is contained in:
Jonathan Wilde 2013-06-12 12:16:03 -07:00
parent acfabff83c
commit 473f3f52c4
6 changed files with 16 additions and 128 deletions

View File

@ -129,63 +129,6 @@
</handlers>
</binding>
<!-- remnants of the old fennec content navigation system, now just the find bar. this can be stripped down further. -->
<binding id="content-navigator">
<content class="window-width content-navigator-box" orient="horizontal" pack="start">
<children includes="textbox"/>
<xul:button anonid="previous-button" class="content-navigator-item previous-button" xbl:inherits="command=previous"/>
<xul:button anonid="next-button" class="content-navigator-item next-button" xbl:inherits="command=next"/>
<xul:spacer flex="1"/>
<xul:button anonid="close-button" class="content-navigator-item close-button" xbl:inherits="command=close"/>
</content>
<implementation>
<field name="_previousButton">
document.getAnonymousElementByAttribute(this, "anonid", "previous-button");
</field>
<field name="_nextButton">
document.getAnonymousElementByAttribute(this, "anonid", "next-button");
</field>
<field name="_closeButton">
document.getAnonymousElementByAttribute(this, "anonid", "close-button");
</field>
<property name="isActive" onget="return !!this.model;"/>
<field name="model">null</field>
<method name="show">
<parameter name="aModel" />
<body><![CDATA[
this.setAttribute("type", aModel.type);
this.setAttribute("next", aModel.commands.next);
this.setAttribute("previous", aModel.commands.previous);
this.setAttribute("close", aModel.commands.close);
// buttons attributes sync with commands doesn not look updated when
// we dynamically switch the "command" attribute so we need to ensure
// the disabled state of the buttons is right when switching commands
this._previousButton.disabled = document.getElementById(aModel.commands.previous).getAttribute("disabled") == "true";
this._nextButton.disabled = document.getElementById(aModel.commands.next).getAttribute("disabled") == "true";
this.model = aModel;
]]></body>
</method>
<method name="hide">
<parameter name="aModel" />
<body><![CDATA[
this.removeAttribute("next");
this.removeAttribute("previous");
this.removeAttribute("close");
this.removeAttribute("type");
this.model = null;
]]></body>
</method>
</implementation>
</binding>
<binding id="menulist" display="xul:box" extends="chrome://global/content/bindings/menulist.xml#menulist">
<handlers>
<handler event="mousedown" phase="capturing">

View File

@ -10,10 +10,6 @@ browser[remote="true"] {
-moz-binding: url("chrome://browser/content/bindings/browser.xml#remote-browser");
}
#content-navigator {
-moz-binding: url("chrome://browser/content/bindings/bindings.xml#content-navigator");
}
#tabs {
-moz-binding: url("chrome://browser/content/bindings/tabs.xml#tablist");
}

View File

@ -112,12 +112,7 @@
<command id="cmd_delete" oncommand="CommandUpdater.doCommand(this.id);"/>
<command id="cmd_selectAll" oncommand="CommandUpdater.doCommand(this.id);"/>
<!-- forms navigation -->
<command id="cmd_formPrevious" oncommand="FormHelperUI.goToPrevious();"/>
<command id="cmd_formNext" oncommand="FormHelperUI.goToNext();"/>
<command id="cmd_formClose" oncommand="FormHelperUI.hide();"/>
<!-- find navigation -->
<!-- find -->
<command id="cmd_findPrevious" oncommand="FindHelperUI.goToPrevious();"/>
<command id="cmd_findNext" oncommand="FindHelperUI.goToNext();"/>
<command id="cmd_findClose" oncommand="FindHelperUI.hide();"/>
@ -247,9 +242,13 @@
</vbox>
<!-- popup for content navigator helper -->
<vbox id="content-navigator">
<appbar id="content-navigator" class="window-width content-navigator-box" orient="horizontal" pack="start">
<textbox id="find-helper-textbox" class="search-bar content-navigator-item" oncommand="FindHelperUI.search(this.value)" oninput="FindHelperUI.updateCommands(this.value);" type="search"/>
</vbox>
<button class="content-navigator-item previous-button" command="cmd_findPrevious"/>
<button class="content-navigator-item next-button" command="cmd_findNext"/>
<spacer flex="1"/>
<button class="content-navigator-item close-button" command="cmd_findClose"/>
</appbar>
<vbox id="panel-container" hidden="true" class="window-width window-height meta" observes="bcast_windowState">
<hbox id="panel-header">

View File

@ -112,16 +112,15 @@ var FindHelperUI = {
// Shutdown selection related ui
SelectionHelperUI.closeEditSession();
// See bindings.xml
this._container.show(this);
this.search(this._textbox.value);
this._textbox.select();
this._textbox.focus();
this._open = true;
let findbar = this._container;
setTimeout(() => {
Elements.browsers.setAttribute("findbar", true);
this._container.setAttribute("showing", true)
findbar.show();
}, 0);
// Prevent the view to scroll automatically while searching
@ -137,7 +136,6 @@ var FindHelperUI = {
this._textbox.value = "";
this.status = null;
this._textbox.blur();
this._container.hide(this);
this._open = false;
// Restore the scroll synchronisation
@ -145,7 +143,7 @@ var FindHelperUI = {
};
this._container.addEventListener("transitionend", onTransitionEnd, true);
this._container.removeAttribute("showing");
this._container.dismiss();
Elements.browsers.removeAttribute("findbar");
},

View File

@ -28,11 +28,6 @@ var SelectHelperUI = {
},
show: function selectHelperShow(aList, aTitle, aRect) {
if (AnimatedZoom.isZooming()) {
FormHelperUI._waitForZoom(this.show.bind(this, aList, aTitle, aRect));
return;
}
if (this._list)
this.reset();

View File

@ -8,30 +8,19 @@
/* Find bar ------------------------------------------------------------- */
#content-navigator {
display: block;
position: fixed;
pointer-events: none;
padding: 0;
bottom: 0;
transform: translateY(100%);
transition: transform @metro_animation_duration@ @metro_animation_easing@;
background-color: @metro_orange@;
padding: 0;
pointer-events: none;
}
#content-navigator[showing] {
transform: none;
}
#stack[keyboardVisible] > #content-navigator {
/* Slow the bottom up transition since it's impossible to match the system's
soft keyboard movement. */
transition: transform @metro_animation_duration@ @metro_animation_easing@,
bottom @appbar_keyboard_slideup_duration@ @metro_animation_easing@;
#content-navigator > toolbar {
min-height: @findbar_height@ !important;
}
#content-navigator > .previous-button,
#content-navigator > .next-button,
#content-navigator > .close-button {
list-style-image: url(chrome://browser/skin/images/appbar-icons.png);
min-width: @touch_button_small@ !important; /* button size */
min-height: @touch_button_small@ !important; /* button size */
border: none !important;
@ -44,7 +33,6 @@
#content-navigator > .close-button {
-moz-margin-start: 0;
list-style-image: url(chrome://browser/skin/images/appbar-icons.png);
-moz-image-region: rect(0px, 480px, 40px, 440px);
}
@ -58,7 +46,6 @@
#content-navigator > .previous-button {
-moz-margin-end: 0;
list-style-image: url(chrome://browser/skin/images/appbar-icons.png);
-moz-image-region: rect(0px, 400px, 40px, 360px);
}
@ -70,19 +57,8 @@
-moz-image-region: rect(80px, 400px, 120px, 360px);
}
#content-navigator:-moz-locale-dir(ltr) > .previous-button {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
#content-navigator:-moz-locale-dir(rtl) > .previous-button {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
#content-navigator > .next-button {
-moz-margin-start: 0;
list-style-image: url(chrome://browser/skin/images/appbar-icons.png);
-moz-image-region: rect(0px, 440px, 40px, 400px);
}
@ -94,25 +70,6 @@
-moz-image-region: rect(80px, 440px, 120px, 400px);
}
#content-navigator:-moz-locale-dir(ltr) > .next-button {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
#content-navigator:-moz-locale-dir(rtl) > .next-button {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
#content-navigator[type="find"] > .previous-button {
/* previous button overlap the textbox */
-moz-margin-start: -@margin_normal@;
}
#content-navigator:not([type="find"]) > #find-helper-textbox {
display: none;
}
#find-helper-textbox {
pointer-events: auto;
-moz-margin-end: 0;