mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/12542] Rename javascript method and add doc block
PHPBB3-12542
This commit is contained in:
parent
ae8129b699
commit
c018b3bbc7
2 changed files with 16 additions and 2 deletions
|
@ -1232,7 +1232,19 @@ phpbb.applyCodeEditor = function(textarea) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
phpbb.applyDragNDrop = function(textarea) {
|
/**
|
||||||
|
* Show drag and drop animation when textarea is present
|
||||||
|
*
|
||||||
|
* This function will enable the drag and drop animation for a specified
|
||||||
|
* textarea.
|
||||||
|
*
|
||||||
|
* @param {object} textarea Textarea DOM object to apply editor to
|
||||||
|
*/
|
||||||
|
phpbb.showDragNDrop = function(textarea) {
|
||||||
|
if (textarea === 'undefined') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$('body').on('dragenter dragover', function () {
|
$('body').on('dragenter dragover', function () {
|
||||||
$(textarea).addClass('drag-n-drop');
|
$(textarea).addClass('drag-n-drop');
|
||||||
}).on('dragleave dragout dragend drop', function() {
|
}).on('dragleave dragout dragend drop', function() {
|
||||||
|
|
|
@ -355,7 +355,9 @@ function getCaretPosition(txtarea) {
|
||||||
textarea = doc.forms[form_name].elements[text_name];
|
textarea = doc.forms[form_name].elements[text_name];
|
||||||
|
|
||||||
phpbb.applyCodeEditor(textarea);
|
phpbb.applyCodeEditor(textarea);
|
||||||
phpbb.applyDragNDrop(textarea);
|
if ($('#attach-panel').length) {
|
||||||
|
phpbb.showDragNDrop(textarea);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue