From 41df776ab697ea8ab7fe2f64b296b8b62a11e50b Mon Sep 17 00:00:00 2001 From: Rob Campbell Date: Thu, 22 Dec 2011 14:58:17 -0400 Subject: [PATCH] Bug 712113 - Either brace should be clickable to add new properties in the Style panel's Rule View; r=jwalker --- browser/devtools/styleinspector/CssRuleView.jsm | 16 +++++++++++++--- .../themes/gnomestripe/devtools/csshtmltree.css | 5 +++++ .../themes/pinstripe/devtools/csshtmltree.css | 5 +++++ .../themes/winstripe/devtools/csshtmltree.css | 5 +++++ 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/browser/devtools/styleinspector/CssRuleView.jsm b/browser/devtools/styleinspector/CssRuleView.jsm index 889cc6d9c49..a359c4b6500 100644 --- a/browser/devtools/styleinspector/CssRuleView.jsm +++ b/browser/devtools/styleinspector/CssRuleView.jsm @@ -13,7 +13,7 @@ * for the specific language governing rights and limitations under the * License. * - * The Original Code is the Mozilla Inspector Module. + * The Original Code is the Mozilla CSS Rule View. * * The Initial Developer of the Original Code is * The Mozilla Foundation. @@ -21,7 +21,8 @@ * the Initial Developer. All Rights Reserved. * * Contributor(s): - * Dave Camp (dcamp@mozilla.com) (Original Author) + * Dave Camp (Original Author) + * Rob Campbell * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -778,7 +779,16 @@ RuleEditor.prototype = { class: "ruleview-selector", textContent: this.rule.selectorText }); - appendText(header, " {"); + + this.openBrace = createChild(header, "span", { + class: "ruleview-ruleopen", + tabindex: "0", + textContent: " {" + }); + + this.openBrace.addEventListener("click", function() { + this.newProperty(); + }.bind(this), true); this.propertyList = createChild(code, "ul", { class: "ruleview-propertylist" diff --git a/browser/themes/gnomestripe/devtools/csshtmltree.css b/browser/themes/gnomestripe/devtools/csshtmltree.css index 432bfbdd4b4..774ace1c269 100644 --- a/browser/themes/gnomestripe/devtools/csshtmltree.css +++ b/browser/themes/gnomestripe/devtools/csshtmltree.css @@ -23,6 +23,7 @@ * Mihai Șucan * Michael Ratcliffe * Dão Gottwald + * Rob Campbell * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -229,6 +230,10 @@ padding: 2px 5px; } +.ruleview-ruleopen { + -moz-padding-end: 5px; +} + .ruleview-propertylist { list-style: none; padding: 0; diff --git a/browser/themes/pinstripe/devtools/csshtmltree.css b/browser/themes/pinstripe/devtools/csshtmltree.css index dc8add1999a..93d506abd92 100644 --- a/browser/themes/pinstripe/devtools/csshtmltree.css +++ b/browser/themes/pinstripe/devtools/csshtmltree.css @@ -23,6 +23,7 @@ * Mihai Șucan * Michael Ratcliffe * Dão Gottwald + * Rob Campbell * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -231,6 +232,10 @@ padding: 2px 5px; } +.ruleview-ruleopen { + -moz-padding-end: 5px; +} + .ruleview-propertylist { list-style: none; padding: 0; diff --git a/browser/themes/winstripe/devtools/csshtmltree.css b/browser/themes/winstripe/devtools/csshtmltree.css index 091bae5dbfe..9a0e4c03b0d 100644 --- a/browser/themes/winstripe/devtools/csshtmltree.css +++ b/browser/themes/winstripe/devtools/csshtmltree.css @@ -23,6 +23,7 @@ * Mihai Șucan * Michael Ratcliffe * Dão Gottwald + * Rob Campbell * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -230,6 +231,10 @@ padding: 2px 5px; } +.ruleview-ruleopen { + -moz-padding-end: 5px; +} + .ruleview-propertylist { list-style: none; padding: 0;