From c305e920e5ebea10caf81df3112c1503e7bfcbe3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Jun 2016 16:26:15 +0200 Subject: [PATCH] ASYNCUP-21 : modify main.js file to allow several handlers on same page --- .../skin/plugins/asynchronousupload/main.js | 187 +++++++++--------- 1 file changed, 97 insertions(+), 90 deletions(-) diff --git a/webapp/WEB-INF/templates/skin/plugins/asynchronousupload/main.js b/webapp/WEB-INF/templates/skin/plugins/asynchronousupload/main.js index 68d1e40..92f7249 100644 --- a/webapp/WEB-INF/templates/skin/plugins/asynchronousupload/main.js +++ b/webapp/WEB-INF/templates/skin/plugins/asynchronousupload/main.js @@ -10,111 +10,118 @@ */ /* global $, window */ +Array.prototype.contains = function (object){ + + for(i in this){ + if(this[i] == object){ + return true; + } + } + return false; +} +if(typeof(handlerList)==='undefined'){ +handlerList=[] +} +if (!handlerList.contains('${handler_name}')){ + + handlerList.push('${handler_name}'); + $(function () { - 'use strict'; - - var uploadButton = $('