From 4316558bf01d8f4267376222a82e36948f974529 Mon Sep 17 00:00:00 2001 From: Paul Rouget Date: Thu, 22 May 2014 09:16:13 +0200 Subject: [PATCH] Bug 1013872 - [appmgr v2] runtime button doesn't turn blue if not project is selected. r=janx r=ochameau --- browser/devtools/webide/content/webide.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/browser/devtools/webide/content/webide.js b/browser/devtools/webide/content/webide.js index 9a25bc67d260..655aab49cbd4 100644 --- a/browser/devtools/webide/content/webide.js +++ b/browser/devtools/webide/content/webide.js @@ -245,8 +245,7 @@ let UI = { }, updateRuntimeButton: function() { - let buttonNode = document.querySelector("#runtime-panel-button"); - let labelNode = buttonNode.querySelector(".panel-button-label"); + let labelNode = document.querySelector("#runtime-panel-button > .panel-button-label"); if (!AppManager.selectedRuntime) { labelNode.setAttribute("value", Strings.GetStringFromName("runtimeButton_label")); } else { @@ -375,8 +374,6 @@ let UI = { document.querySelector("#cmd_showProjectPanel").removeAttribute("disabled"); document.querySelector("#cmd_showRuntimePanel").removeAttribute("disabled"); - document.querySelector("#runtime-panel-button").removeAttribute("active"); - // Action commands let playCmd = document.querySelector("#cmd_play"); let stopCmd = document.querySelector("#cmd_stop"); @@ -410,7 +407,6 @@ let UI = { playCmd.setAttribute("disabled", "true"); } } - document.querySelector("#runtime-panel-button").setAttribute("active", "true"); } // Remove command @@ -429,18 +425,21 @@ let UI = { let box = document.querySelector("#runtime-actions"); + let runtimePanelButton = document.querySelector("#runtime-panel-button"); if (AppManager.connection.status == Connection.Status.CONNECTED) { screenshotCmd.removeAttribute("disabled"); permissionsCmd.removeAttribute("disabled"); disconnectCmd.removeAttribute("disabled"); detailsCmd.removeAttribute("disabled"); box.removeAttribute("hidden"); + runtimePanelButton.setAttribute("active", "true"); } else { screenshotCmd.setAttribute("disabled", "true"); permissionsCmd.setAttribute("disabled", "true"); disconnectCmd.setAttribute("disabled", "true"); detailsCmd.setAttribute("disabled", "true"); box.setAttribute("hidden", "true"); + runtimePanelButton.removeAttribute("active"); } },