Skip to content

Commit

Permalink
[mms] Re-enable drag/drop of text to dynamic plaintext compose window…
Browse files Browse the repository at this point in the history
… (Bug #13281).
  • Loading branch information
slusarz committed Jul 10, 2014
1 parent 227c58d commit 986c75c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 11 deletions.
9 changes: 9 additions & 0 deletions imp/docs/CHANGES
Expand Up @@ -3,6 +3,15 @@ v6.3.0-git
----------



------
v6.2.1
------

[mms] Re-enable drag/drop of text to dynamic plaintext compose window (Bug
#13281).


------
v6.2.0
------
Expand Down
4 changes: 1 addition & 3 deletions imp/js/ckeditor/pasteattachment.js
Expand Up @@ -69,9 +69,7 @@ CKEDITOR.plugins.add('pasteattachment', {

/* Only handle file data here. For other data (i.e. text)
* have the browser handle it natively. */
if (!d.dataTransfer ||
!d.dataTransfer.files ||
!d.dataTransfer.files.length) {
if (!DragHandler.isFileDrag(d)) {
return;
}

Expand Down
21 changes: 14 additions & 7 deletions imp/js/draghandler.js
@@ -1,5 +1,5 @@
/**
* DragHandler library (files support only) for use with prototypejs.
* DragHandler library for use with prototypejs.
*
* @author Michael Slusarz <slusarz@horde.org>
* @copyright 2013-2014 Horde LLC
Expand All @@ -11,10 +11,17 @@ var DragHandler = {
// dropelt,
// droptarget,
// hoverclass,
// leave
// leave,

to: -1,

isFileDrag: function(e)
{
return (e.dataTransfer &&
e.dataTransfer.files &&
e.dataTransfer.files.length);
},

handleObserve: function(e)
{
if (this.dropelt &&
Expand Down Expand Up @@ -43,12 +50,14 @@ var DragHandler = {

handleDrop: function(e)
{
if (this.dropelt.hasClassName(this.hoverclass)) {
this.dropelt.fire('DragHandler:drop', e.dataTransfer.files);
if (this.isFileDrag(e)) {
if (this.dropelt.hasClassName(this.hoverclass)) {
this.dropelt.fire('DragHandler:drop', e.dataTransfer.files);
}
e.stop();
}
this.leave = true;
this.hide();
e.stop();
},

hide: function()
Expand Down Expand Up @@ -81,8 +90,6 @@ var DragHandler = {
} else {
this.dropelt.removeClassName(this.hoverclass);
}

e.stop();
}

};
Expand Down
15 changes: 14 additions & 1 deletion imp/package.xml
Expand Up @@ -33,7 +33,7 @@
</stability>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
*
* [mms] Re-enable drag/drop of text to dynamic plaintext compose window (Bug #13281).
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -3687,5 +3687,18 @@
* [mjr] Fix fatal error when printing empty HTML attachments (Bug #13322).
</notes>
</release>
<release>
<version>
<release>6.2.1</release>
<api>6.2.0</api></version>
<stability>
<release>stable</release>
<api>stable</api></stability>
<date>2014-07-08</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [mms] Re-enable drag/drop of text to dynamic plaintext compose window (Bug #13281).
</notes>
</release>
</changelog>
</package>

0 comments on commit 986c75c

Please sign in to comment.