Skip to content
Browse files

Issue 5505: Text not always saved when editing stops

  • Loading branch information...
1 parent 5512141 commit 36522097d01c94441885ccb927f9a7b697b1d68a @janodvarko janodvarko committed May 30, 2012
Showing with 17 additions and 6 deletions.
  1. +13 −5 extension/content/firebug/editor/editor.js
  2. +4 −1 extension/content/firebug/html/htmlPanel.js
View
18 extension/content/firebug/editor/editor.js
@@ -125,7 +125,14 @@ Firebug.Editor = Obj.extend(Firebug.Module,
return;
if (FBTrace.DBG_EDITOR)
- FBTrace.sysout("editor.stopEditing cancel:" + cancel+" saveTimeout: "+this.saveTimeout);
+ {
+ FBTrace.sysout("editor.stopEditing cancel:" + cancel+" saveTimeout: " +
+ this.saveTimeout);
+ }
+
+ // Make sure the content is save if there is a timeout in progress.
+ if (this.saveTimeout)
+ this.save();
clearTimeout(this.saveTimeout);
delete this.saveTimeout;
@@ -151,8 +158,8 @@ Firebug.Editor = Obj.extend(Firebug.Module,
{
if (cancel)
{
- Events.dispatch(currentPanel.fbListeners, 'onInlineEditorClose', [currentPanel,
- currentTarget, removeGroup && !originalValue]);
+ Events.dispatch(currentPanel.fbListeners, "onInlineEditorClose",
+ [currentPanel, currentTarget, removeGroup && !originalValue]);
if (value != originalValue)
this.saveEditAndNotifyListeners(currentTarget, originalValue, previousValue);
@@ -180,10 +187,11 @@ Firebug.Editor = Obj.extend(Firebug.Module,
currentEditor.hide();
currentPanel.editing = false;
- Events.dispatch(this.fbListeners, "onStopEdit", [currentPanel, currentEditor, currentTarget]);
+ Events.dispatch(this.fbListeners, "onStopEdit", [currentPanel, currentEditor,
+ currentTarget]);
if (FBTrace.DBG_EDITOR)
- FBTrace.sysout("Editor stop panel "+currentPanel.name);
+ FBTrace.sysout("Editor stop panel " + currentPanel.name);
currentTarget = null;
currentGroup = null;
View
5 extension/content/firebug/html/htmlPanel.js
@@ -2129,8 +2129,9 @@ TextNodeEditor.prototype = domplate(Firebug.InlineEditor.prototype,
if (!node)
return;
- value = Str.unescapeForTextNode(value || '');
+ value = Str.unescapeForTextNode(value || "");
target.innerHTML = Str.escapeForTextNode(value);
+
if (node instanceof window.Element)
{
if (Xml.isElementMathML(node) || Xml.isElementSVG(node))
@@ -2151,6 +2152,8 @@ TextNodeEditor.prototype = domplate(Firebug.InlineEditor.prototype,
}
catch (e)
{
+ if (FBTrace.DBG_ERRORS)
+ FBTrace.sysout("htmlPanel.saveEdit; EXCEPTION " + e, e);
}
}
}

0 comments on commit 3652209

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