From b42ef163e51a771ceb942c1d33155c1ec24e3c0f Mon Sep 17 00:00:00 2001 From: Cedric Vivier Date: Fri, 13 Jan 2012 00:26:31 +0800 Subject: [PATCH] Bug 701635 - Style Editor should have a page loading placeholder; r=rcampbell --- .../styleeditor/StyleEditorChrome.jsm | 11 ++++++++- browser/devtools/styleeditor/splitview.css | 4 ++++ browser/devtools/styleeditor/styleeditor.xul | 8 ++++--- .../test/browser_styleeditor_loading.js | 24 +++++++++++++++++++ .../themes/gnomestripe/devtools/splitview.css | 6 +++++ .../gnomestripe/devtools/styleeditor.css | 4 ++++ .../themes/pinstripe/devtools/splitview.css | 6 +++++ .../themes/pinstripe/devtools/styleeditor.css | 4 ++++ .../themes/winstripe/devtools/splitview.css | 6 +++++ .../themes/winstripe/devtools/styleeditor.css | 4 ++++ 10 files changed, 73 insertions(+), 4 deletions(-) diff --git a/browser/devtools/styleeditor/StyleEditorChrome.jsm b/browser/devtools/styleeditor/StyleEditorChrome.jsm index b71a8d15bbb..097fda5746b 100644 --- a/browser/devtools/styleeditor/StyleEditorChrome.jsm +++ b/browser/devtools/styleeditor/StyleEditorChrome.jsm @@ -156,11 +156,14 @@ StyleEditorChrome.prototype = { aContentWindow.addEventListener("unload", onContentUnload, false); if (aContentWindow.document.readyState == "complete") { + this._root.classList.remove("loading"); this._populateChrome(); return; } else { + this._root.classList.add("loading"); let onContentReady = function () { aContentWindow.removeEventListener("load", onContentReady, false); + this._root.classList.remove("loading"); this._populateChrome(); }.bind(this); aContentWindow.addEventListener("load", onContentReady, false); @@ -299,7 +302,7 @@ StyleEditorChrome.prototype = { }, /** - * Reset the chrome UI to an empty state. + * Reset the chrome UI to an empty and ready state. */ _resetChrome: function SEC__resetChrome() { @@ -309,6 +312,12 @@ StyleEditorChrome.prototype = { this._editors = []; this._view.removeAll(); + + // (re)enable UI + let matches = this._root.querySelectorAll("toolbarbutton,input,select"); + for (let i = 0; i < matches.length; ++i) { + matches[i].removeAttribute("disabled"); + } }, /** diff --git a/browser/devtools/styleeditor/splitview.css b/browser/devtools/styleeditor/splitview.css index cf1f68eb069..1bc27022510 100644 --- a/browser/devtools/styleeditor/splitview.css +++ b/browser/devtools/styleeditor/splitview.css @@ -46,6 +46,10 @@ box, -moz-box-pack: center; } +.loading .splitview-nav-container > .placeholder { + display: none !important; +} + .splitview-controller, .splitview-main { -moz-box-flex: 0; diff --git a/browser/devtools/styleeditor/styleeditor.xul b/browser/devtools/styleeditor/styleeditor.xul index 86c12abf935..b29f64d4079 100644 --- a/browser/devtools/styleeditor/styleeditor.xul +++ b/browser/devtools/styleeditor/styleeditor.xul @@ -54,18 +54,20 @@ persist="screenX screenY width height sizemode"> - + + label="&newButton.label;" + disabled="true"/> + label="&importButton.label;" + disabled="true"/>