From 54739be5e0cc6cdf1820507624d0ab7e6039d4e0 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 6 Dec 2007 23:55:39 +0000 Subject: [PATCH] Monotone-Parent: f440f1d2a2686eb9dd6e54c78651ec0dd6197a8a Monotone-Revision: de5df66679da8b8e87d75ec3e045d06880110b27 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-12-06T23:55:39 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/UIxMailEditor.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/UI/WebServerResources/UIxMailEditor.js b/UI/WebServerResources/UIxMailEditor.js index ed5796366..0925b03e6 100644 --- a/UI/WebServerResources/UIxMailEditor.js +++ b/UI/WebServerResources/UIxMailEditor.js @@ -214,6 +214,7 @@ function onAttachmentChange(event) { this.removeClassName("currentAttachment"); var list = $("attachments"); createAttachment(this, list); + clickedEditorAttach(null) } } @@ -249,6 +250,12 @@ function clickedEditorSave(sender) { } function onTextFocus() { + var input = currentAttachmentInput(); + if (input) + input.parentNode.removeChild(input); +} + +function onTextFirstFocus() { var content = this.getValue(); if (content.lastIndexOf("--") == 0) { this.insertBefore(document.createTextNode("\r\n"), @@ -258,7 +265,7 @@ function onTextFocus() { var length = this.getValue().length - signatureLength - 1; this.setCaretTo(length); } - Event.stopObserving(this, "focus", onTextFocus); + Event.stopObserving(this, "focus", onTextFirstFocus); } function initMailEditor() { @@ -283,6 +290,7 @@ function initMailEditor() { if (sigLimit > -1) signatureLength = (textContent.length - sigLimit); textarea.scrollTop = textarea.scrollHeight; + textarea.observe("focus", onTextFirstFocus); textarea.observe("focus", onTextFocus); onWindowResize(null);