Skip to content
Browse files

Properly updat the Edit button (related to issue 5506)

  • Loading branch information...
1 parent 9f8b93a commit d3e4858ae7f77ec23fe45c5ac1952223f0f3275b @janodvarko janodvarko committed
Showing with 7 additions and 3 deletions.
  1. +7 −3 extension/content/firebug/html/htmlPanel.js
View
10 extension/content/firebug/html/htmlPanel.js
@@ -174,6 +174,12 @@ Firebug.HTMLPanel.prototype = Obj.extend(WalkingPanel,
this.selection = object;
this.updateSelection(object);
+ // The Edit button (in the toolbar) must be updated every time the selection
+ // changes. Some elements (such as <html>) can't be edited.
+ var edit = Firebug.chrome.$("fbToggleHTMLEditing");
+ edit.disabled = object ? Css.nonEditableTags.hasOwnProperty(object.localName) : false;
+
+ // Distribute selection change further to listeners.
Events.dispatch(Firebug.uiListeners, "onObjectSelected", [object, this]);
// If the 'free text' edit mode is active change the current markup
@@ -1097,10 +1103,8 @@ Firebug.HTMLPanel.prototype = Obj.extend(WalkingPanel,
this.noScrollIntoView = true;
this.select(node);
- Firebug.chrome.$('fbToggleHTMLEditing').disabled =
- Css.nonEditableTags.hasOwnProperty(node.localName);
-
delete this.noScrollIntoView;
+
if (Css.hasClass(event.target, "twisty"))
this.toggleNode(event);
}

0 comments on commit d3e4858

Please sign in to comment.
Something went wrong with that request. Please try again.