Bug 1006586 - Remove smoothscrolling from the breadcrumbs widget, r=rcampbell

This commit is contained in:
Victor Porof 2014-05-07 09:38:17 -04:00
parent cf39db4063
commit 280e958bf8

View File

@ -23,8 +23,10 @@ this.EXPORTED_SYMBOLS = ["BreadcrumbsWidget"];
*
* @param nsIDOMNode aNode
* The element associated with the widget.
* @param Object aOptions
* - smoothScroll: specifies if smooth scrolling on selection is enabled.
*/
this.BreadcrumbsWidget = function BreadcrumbsWidget(aNode) {
this.BreadcrumbsWidget = function BreadcrumbsWidget(aNode, aOptions={}) {
this.document = aNode.ownerDocument;
this.window = this.document.defaultView;
this._parent = aNode;
@ -34,7 +36,8 @@ this.BreadcrumbsWidget = function BreadcrumbsWidget(aNode) {
this._list.className = "breadcrumbs-widget-container";
this._list.setAttribute("flex", "1");
this._list.setAttribute("orient", "horizontal");
this._list.setAttribute("clicktoscroll", "true")
this._list.setAttribute("clicktoscroll", "true");
this._list.setAttribute("smoothscroll", !!aOptions.smoothScroll);
this._list.addEventListener("keypress", e => this.emit("keyPress", e), false);
this._list.addEventListener("mousedown", e => this.emit("mousePress", e), false);
this._parent.appendChild(this._list);
@ -46,7 +49,6 @@ this.BreadcrumbsWidget = function BreadcrumbsWidget(aNode) {
this._list.addEventListener("underflow", this._onUnderflow.bind(this), false);
this._list.addEventListener("overflow", this._onOverflow.bind(this), false);
// These separators are used for CSS purposes only, and are positioned
// off screen, but displayed with -moz-element.
this._separators = this.document.createElement("box");