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
Родитель e6ccbe9ac8
Коммит 242aa2924d
2 изменённых файлов: 13 добавлений и 6 удалений

Просмотреть файл

@ -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 }
})

Просмотреть файл

@ -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;
},