Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Issue 5951: Title of array-like objects should be clickable

  • Loading branch information...
commit 3c90164e249b3144adcdb94bd53ea37763a6c718 1 parent a8016d3
@janodvarko janodvarko authored
Showing with 17 additions and 4 deletions.
  1. +17 −4 extension/content/firebug/chrome/reps.js
View
21 extension/content/firebug/chrome/reps.js
@@ -794,13 +794,18 @@ FirebugReps.Arr = domplate(FirebugReps.ArrBase,
// ********************************************************************************************* //
-FirebugReps.ArrayishObject = domplate(FirebugReps.ArrBase,
+/**
+ * Any arrayish object that is not directly Array type (e.g. HTMLCollection, NodeList, etc.)
+ */
+FirebugReps.ArrayLikeObject = domplate(FirebugReps.ArrBase,
{
tag:
OBJECTBOX({_repObject: "$object",
$hasTwisty: "$object|hasSpecialProperties",
onclick: "$onToggleProperties"},
- SPAN({"class": "objectTitle"}, "$object|getTitle "),
+ A({"class": "objectTitle objectLink", onclick: "$onClickTitle"},
+ "$object|getTitle"
+ ),
SPAN({"class": "arrayLeftBracket", role: "presentation"}, "["),
FOR("item", "$object|longArrayIterator",
TAG("$item.tag", {object: "$item.object"}),
@@ -814,7 +819,9 @@ FirebugReps.ArrayishObject = domplate(FirebugReps.ArrBase,
OBJECTBOX({_repObject: "$object",
$hasTwisty: "$object|hasSpecialProperties",
onclick: "$onToggleProperties"},
- SPAN({"class": "objectTitle"}, "$object|getTitle "),
+ A({"class": "objectTitle objectLink", onclick: "$onClickTitle"},
+ "$object|getTitle"
+ ),
SPAN({"class": "arrayLeftBracket", role: "presentation"}, "["),
FOR("item", "$object|shortArrayIterator",
TAG("$item.tag", {object: "$item.object"}),
@@ -824,6 +831,12 @@ FirebugReps.ArrayishObject = domplate(FirebugReps.ArrBase,
SPAN({"class": "arrayProperties", role: "group"})
),
+ onClickTitle: function(event)
+ {
+ var obj = Firebug.getRepObject(event.target);
+ Firebug.chrome.select(obj);
+ },
+
getTitle: function(object, context)
{
const re =/\[object ([^\]]*)/;
@@ -3242,7 +3255,7 @@ Firebug.registerRep(
FirebugReps.Except,
FirebugReps.XML,
FirebugReps.Arr,
- FirebugReps.ArrayishObject,
+ FirebugReps.ArrayLikeObject,
FirebugReps.XPathResult,
FirebugReps.Storage,
FirebugReps.Attr,
Please sign in to comment.
Something went wrong with that request. Please try again.