From f16ec30a464c8b6f186d897820b9502e07225a94 Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Thu, 18 Jul 2013 13:59:14 -0400 Subject: [PATCH] Bug 873712 - Add "overflowed" property to CustomizableUI widgets. r=Gijs. --- .../components/customizableui/src/CustomizableUI.jsm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/browser/components/customizableui/src/CustomizableUI.jsm b/browser/components/customizableui/src/CustomizableUI.jsm index fdb96ff74f1..445c4973c21 100644 --- a/browser/components/customizableui/src/CustomizableUI.jsm +++ b/browser/components/customizableui/src/CustomizableUI.jsm @@ -851,6 +851,7 @@ let CustomizableUIInternal = { node.setAttribute("disabled", true); } node.setAttribute("removable", aWidget.removable); + node.setAttribute("nooverflow", aWidget.nooverflow); node.setAttribute("label", this.getLocalizedProperty(aWidget, "label")); node.setAttribute("tooltiptext", this.getLocalizedProperty(aWidget, "tooltiptext")); //XXXunf Need to hook this up to a element or something. @@ -1467,6 +1468,7 @@ let CustomizableUIInternal = { instances: new Map(), currentArea: null, removable: false, + nooverflow: false, defaultArea: null, allowedAreas: [], shortcut: null, @@ -1496,7 +1498,7 @@ let CustomizableUIInternal = { } } - const kOptBoolProps = ["removable", "showInPrivateBrowsing"] + const kOptBoolProps = ["removable", "showInPrivateBrowsing", "nooverflow"] for (let prop of kOptBoolProps) { if (typeof aData[prop] == "boolean") { widget[prop] = aData[prop]; @@ -2079,6 +2081,9 @@ function WidgetSingleWrapper(aWidget, aNode) { return aNode.getAttribute("customizableui-areatype") || ""; }); + this.__defineGetter__("overflowed", function() { + return aNode.classList.contains("overflowedItem"); + }); Object.freeze(this); } @@ -2149,6 +2154,10 @@ function XULWidgetSingleWrapper(aWidgetId, aNode) { return aNode.getAttribute("customizableui-areatype") || ""; }); + this.__defineGetter__("overflowed", function() { + return aNode.classList.contains("overflowedItem"); + }); + Object.freeze(this); }