Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/ui.js

Issue 5705421486555136: First run page and subscription on install fix (FF for android) (Closed)
Patch Set: moved CustomizableUI initialization into UI.initDone() Created April 25, 2014, 1:57 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/ui.js
===================================================================
--- a/lib/ui.js
+++ b/lib/ui.js
@@ -33,15 +33,6 @@
let {initAntiAdblockNotification} = require("antiadblockInit");
let CustomizableUI;
-try
-{
- ({CustomizableUI}) = Cu.import("resource:///modules/CustomizableUI.jsm", null);
-}
-catch (e)
-{
- // No built-in CustomizableUI API, use our own implementation.
- ({CustomizableUI}) = require("customizableUI");
-}
/**
* Filter corresponding with "disable on site" menu item (set in fillIconMent()).
@@ -148,12 +139,15 @@
this.value = UI.toggleSync();
});
- setChecked("adblockplus-showintoolbar", UI.isToolbarIconVisible());
- addCommandHandler("adblockplus-showintoolbar", function()
+ if (hasToolbar)
{
- UI.toggleToolbarIcon();
- this.value = UI.isToolbarIconVisible();
- });
+ setChecked("adblockplus-showintoolbar", UI.isToolbarIconVisible());
+ addCommandHandler("adblockplus-showintoolbar", function()
+ {
+ UI.toggleToolbarIcon();
+ this.value = UI.isToolbarIconVisible();
+ });
+ }
Wladimir Palant 2014/04/25 14:32:19 Same change would have to be done in fillIconMenu(
saroyanm 2014/04/25 15:10:22 Good point, thanks.
let list = doc.getElementById("adblockplus-subscription-list");
if (list)
@@ -412,6 +406,16 @@
let {defaultToolbarPosition} = require("appSupport");
if ("abp-toolbarbutton" in this.overlay && defaultToolbarPosition)
{
+ try
+ {
+ ({CustomizableUI}) = Cu.import("resource:///modules/CustomizableUI.jsm", null);
+ }
+ catch (e)
+ {
+ // No built-in CustomizableUI API, use our own implementation.
+ ({CustomizableUI}) = require("customizableUI");
+ }
+
CustomizableUI.createWidget({
id: "abp-toolbarbutton",
type: "custom",
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld