Bug 887203 - After replaying a request, hovering the network items menu shows "undefined", r=rcampbell

This commit is contained in:
Victor Porof 2013-06-26 23:35:39 +03:00
parent 125526fd5b
commit 4c8c1ea98f
2 changed files with 13 additions and 6 deletions

View File

@ -337,7 +337,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
this._registerLastRequestEnd(unixTime);
// Append a network request item to this container.
let requestItem = this.push([menuView, aId], {
let requestItem = this.push([menuView, aId, ""], {
attachment: {
startedDeltaMillis: unixTime - this._firstRequestStartedMillis,
startedMillis: unixTime,
@ -368,7 +368,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
// Create the element node for the network request item.
let menuView = this._createMenuView(selected.method, selected.url);
let newItem = this.push([menuView], {
let newItem = this.push([menuView,, ""], {
attachment: Object.create(selected, {
isCustom: { value: true }
})

View File

@ -377,9 +377,13 @@ function Item(aOwnerView, aAttachment, aContents = []) {
this.attachment = aAttachment;
let [aLabel, aValue, aDescription] = aContents;
// Make sure the label and the value are always strings.
this._label = aLabel + "";
this._value = aValue + "";
this._description = (aDescription || "") + "";
// Make sure the description is also a string, but only if it's available.
if (aDescription !== undefined) {
this._description = aDescription + "";
}
// Allow the insertion of prebuilt nodes, otherwise delegate the item view
// creation to a widget.
@ -499,7 +503,7 @@ Item.prototype = {
_label: "",
_value: "",
_description: "",
_description: undefined,
_prebuiltTarget: null,
_target: null,
finalize: null,
@ -663,9 +667,12 @@ this.WidgetMethods = {
if (!selectedItem) {
return false;
}
let { _label: label, _value: value, _description: desc } = selectedItem;
this._widget.removeAttribute("notice");
this._widget.setAttribute("label", selectedItem._label);
this._widget.setAttribute("tooltiptext", selectedItem._value);
this._widget.setAttribute("label", label);
this._widget.setAttribute("tooltiptext", desc !== undefined ? desc : value);
return true;
},