1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-25 20:44:01 +01:00

[ticket/12542] Rename javascript method and add doc block

PHPBB3-12542
This commit is contained in:
Marc Alexander 2015-04-29 12:24:12 +02:00
parent ae8129b699
commit c018b3bbc7
2 changed files with 16 additions and 2 deletions

View File

@ -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 () {
$(textarea).addClass('drag-n-drop');
}).on('dragleave dragout dragend drop', function() {

View File

@ -355,7 +355,9 @@ function getCaretPosition(txtarea) {
textarea = doc.forms[form_name].elements[text_name];
phpbb.applyCodeEditor(textarea);
phpbb.applyDragNDrop(textarea);
if ($('#attach-panel').length) {
phpbb.showDragNDrop(textarea);
}
});
})(jQuery);