Permalink
Browse files

issue 5862 is fixed

  • Loading branch information...
1 parent 6f9218a commit 946d70a1a3a8c269d4c0bf37f9d049b78836a2c4 @farshidbeheshti farshidbeheshti committed Aug 30, 2012
@@ -50,6 +50,14 @@ var CSSDomplateBase =
isSelectorEditable: function(rule)
{
return rule.isSelectorEditable && this.isEditable(rule);
+ },
+
+ getPropertyValue: function(prop)
+ {
+ var limit = Firebug.cssDisplayedPropertyValueLimit;
+ if (limit > 0)
+ return Str.cropString(prop.value, limit);
+ return prop.value;
}
};
@@ -70,7 +78,7 @@ var CSSPropTag = domplate(CSSDomplateBase,
// Use a space here, so that "copy to clipboard" has it (issue 3266).
SPAN({"class": "cssColon"}, ": "),
SPAN({"class": "cssPropValue", $editable: "$rule|isEditable"},
- "$prop.value$prop.important"
+ "$prop|getPropertyValue$prop.important"
),
SPAN({"class": "cssSemi"}, ";"
)
@@ -1252,10 +1260,12 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Firebug.Panel,
var propValue = Dom.getAncestorByClass(target, "cssPropValue");
if (propValue)
{
- var text = propValue.textContent;
+ var styleRule = Firebug.getRepObject(target);
var prop = Dom.getAncestorByClass(target, "cssProp");
var propNameNode = prop.getElementsByClassName("cssPropName").item(0);
var propName = propNameNode.textContent.toLowerCase();
+ var text = styleRule.style[propName];
+
var cssValue;
if (propName == "font" || propName == "font-family")
@@ -1783,6 +1793,20 @@ CSSEditor.prototype = domplate(Firebug.InlineEditor.prototype,
}
},
+ getInitialValue: function(target, value)
+ {
+ var propValue = Dom.getAncestorByClass(target, "cssPropValue");
+ if (propValue)
+ {
+ var styleRule = Firebug.getRepObject(target);
+ var prop = Dom.getAncestorByClass(target, "cssProp");
+ var propNameNode = prop.getElementsByClassName("cssPropName").item(0);
+ var propName = propNameNode.textContent.toLowerCase();
+ value = styleRule.style[propName];
+ }
+ return value;
+ },
+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
getAutoCompleteRange: function(value, offset)
@@ -52,6 +52,7 @@ const prefNames = // XXXjjb TODO distribute to modules
"expandShorthandProps",
"cssEditMode",
"colorDisplay",
+ "cssDisplayedPropertyValueLimit",
// Computed
"computedStylesDisplay",
@@ -79,6 +79,7 @@ pref("extensions.firebug.showUserAgentCSS", false);
pref("extensions.firebug.expandShorthandProps", false);
pref("extensions.firebug.cssEditMode", "Source");
pref("extensions.firebug.colorDisplay", "hex");
+pref("extensions.firebug.cssDisplayedPropertyValueLimit", 100);
// Computed
pref("extensions.firebug.computedStylesDisplay", "grouped");

0 comments on commit 946d70a

Please sign in to comment.