From 3041a8f22c08df96ce5870e099349794df901d9f Mon Sep 17 00:00:00 2001 From: Anon Ray Date: Thu, 22 Aug 2013 20:03:12 +0530 Subject: [PATCH] Add loading of plugin without callback Previously, one had to load plugin providing a callback. Make it optional at backend. Front end has no input for callback. Have to fix that. --- mouchak/static/js/models.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mouchak/static/js/models.js b/mouchak/static/js/models.js index 2eb3de1..eb62443 100644 --- a/mouchak/static/js/models.js +++ b/mouchak/static/js/models.js @@ -76,9 +76,11 @@ var callback = this.get('callback'); script.src = this.get('src'); document.body.appendChild(script); - script.onload = function() { - eval(callback); - }; + if(callback) { + script.onload = function() { + eval(callback); + }; + } } else if(this.get('src').match(/\.css/)) { var link = document.createElement('link'); -- 1.7.10.4