aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/assets/javascript/core.js
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/assets/javascript/core.js')
-rw-r--r--phpBB/assets/javascript/core.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index 806db7d35f..9eb931270a 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -1233,6 +1233,31 @@ phpbb.applyCodeEditor = 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 == null) {
+ return;
+ }
+
+ $('body').on('dragenter dragover', function () {
+ $(textarea).addClass('drag-n-drop');
+ }).on('dragleave dragout dragend drop', function() {
+ $(textarea).removeClass('drag-n-drop');
+ });
+ $(textarea).on('dragenter dragover', function () {
+ $(textarea).addClass('drag-n-drop-highlight');
+ }).on('dragleave dragout dragend drop', function() {
+ $(textarea).removeClass('drag-n-drop-highlight');
+ });
+};
+
+/**
* List of classes that toggle dropdown menu,
* list of classes that contain visible dropdown menu
*