Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Get font preview to work again after the change in 8520d53 (related

to issue 2495)
  • Loading branch information...
commit 1ae347f3958bf02d80c2380ecaf8da4c57bab1ba 1 parent 8520d53
Sebastian Zartner SebastianZ authored
26 extension/content/firebug/css/cssElementPanel.js
View
@@ -555,6 +555,26 @@ CSSElementPanel.prototype = Obj.extend(CSSStyleSheetPanel.prototype,
return ret;
},
+ showInfoTip: function(infoTip, target, x, y, rangeParent, rangeOffset)
+ {
+ var prop = Dom.getAncestorByClass(target, "cssProp");
+ if (prop)
+ var propNameNode = prop.getElementsByClassName("cssPropName").item(0);
+
+ if (propNameNode && (propNameNode.textContent.toLowerCase() == "font" ||
+ propNameNode.textContent.toLowerCase() == "font-family"))
+ {
+ var prevSibling = target.previousElementSibling;
+ while (prevSibling)
+ {
+ rangeOffset += prevSibling.textContent.length;
+ prevSibling = prevSibling.previousElementSibling;
+ }
+ }
+
+ return CSSStyleSheetPanel.prototype.showInfoTip(infoTip, target, x, y, rangeParent, rangeOffset);
+ },
+
updateContentState: function(state, remove)
{
if (FBTrace.DBG_CSS)
@@ -691,16 +711,16 @@ function getFontParts(element, value)
fontParts.before += fonts[i];
if (i < fonts.length-1)
- fontParts.before += ", ";
+ fontParts.before += ",";
}
if (i < fonts.length-1)
- fontParts.after = ", ";
+ fontParts.after = ",";
for (++i; i < fonts.length; ++i)
{
fontParts.after += fonts[i];
if (i < fonts.length-1)
- fontParts.after += ", ";
+ fontParts.after += ",";
}
return fontParts;
4 extension/content/firebug/css/cssPanel.js
View
@@ -1114,7 +1114,9 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Firebug.Panel,
showInfoTip: function(infoTip, target, x, y, rangeParent, rangeOffset)
{
var propValue = Dom.getAncestorByClass(target, "cssPropValue");
- var propNameNode = target.parentNode.getElementsByClassName("cssPropName").item(0);
+ var prop = Dom.getAncestorByClass(target, "cssProp");
+ if (prop)
+ var propNameNode = prop.getElementsByClassName("cssPropName").item(0);
if (propValue)
{
Please sign in to comment.
Something went wrong with that request. Please try again.