Bug 1304352 - Fix title issue in the ObjectRep. r=Honza;
MozReview-Commit-ID: 2oh8mZ4zE2b
--- a/devtools/client/shared/components/reps/object.js
+++ b/devtools/client/shared/components/reps/object.js
@@ -22,22 +22,23 @@ define(function (require, exports, modul
displayName: "Obj",
propTypes: {
object: React.PropTypes.object,
mode: React.PropTypes.string,
},
getTitle: function (object) {
+ let className = object && object.class ? object.class : "Object";
if (this.props.objectLink) {
return this.props.objectLink({
object: object
- }, object.class);
+ }, className);
}
- return "Object";
+ return className;
},
safePropIterator: function (object, max) {
max = (typeof max === "undefined") ? 3 : max;
try {
return this.propIterator(object, max);
} catch (err) {
console.error(err);
@@ -134,17 +135,17 @@ define(function (require, exports, modul
render: function () {
let object = this.props.object;
let props = this.safePropIterator(object);
let objectLink = this.props.objectLink || span;
if (this.props.mode == "tiny" || !props.length) {
return (
span({className: "objectBox objectBox-object"},
- objectLink({className: "objectTitle"}, this.getTitle())
+ objectLink({className: "objectTitle"}, this.getTitle(object))
)
);
}
return (
span({className: "objectBox objectBox-object"},
this.getTitle(object),
objectLink({