From b273774738d035728b016e21d2a198d5867a1f0b Mon Sep 17 00:00:00 2001 From: Ivan Joaquim Date: Wed, 29 Apr 2015 14:51:37 -0300 Subject: [PATCH 1/2] looking for template in script path level --- src/multiselect.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/multiselect.js b/src/multiselect.js index f60c69a..8623d19 100644 --- a/src/multiselect.js +++ b/src/multiselect.js @@ -252,8 +252,23 @@ angular.module('ui.multiselect', []) scope: false, replace: true, templateUrl: function (element, attr) { - return attr.templateUrl || 'multiselect.tmpl.html'; - }, + + var scripts = document.getElementsByTagName("script"); + var filePath = ''; + + for(var scriptKey in scripts){ + var currentScriptPath = scripts[scriptKey].src; + var fileMatch = currentScriptPath.match('multiselect.js'); + + if( fileMatch ){ + filePath = currentScriptPath.slice(0, fileMatch.index); + break;i + } + + } + + return attr.templateUrl || filePath+'multiselect.tmpl.html'; + }, link: function (scope, element, attrs) { scope.isVisible = false; From 08c266c297c5c2dcc1c7f8d157ff2745cb4a78e7 Mon Sep 17 00:00:00 2001 From: Ivan Joaquim Date: Wed, 29 Apr 2015 14:53:08 -0300 Subject: [PATCH 2/2] looking for template in script path level fix --- src/multiselect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multiselect.js b/src/multiselect.js index 8623d19..57796eb 100644 --- a/src/multiselect.js +++ b/src/multiselect.js @@ -262,7 +262,7 @@ angular.module('ui.multiselect', []) if( fileMatch ){ filePath = currentScriptPath.slice(0, fileMatch.index); - break;i + break; } }