From 96821c924422c0d4f7f69a4f479cbd73e2e8b725 Mon Sep 17 00:00:00 2001 From: Dimitris Papazacharias Date: Tue, 19 Sep 2017 19:08:33 +0300 Subject: [PATCH] Replacing className.split with target.hasClass() Instead of checking if className is an actual string in e.target object representing a DOM element (it's not a string in a highcharts graph for example or other sofisticated representations in the Document, I propose wrapping e.target with an angular provided jquery/jqlite object and use provided hasClass() method instead, which propably makes "contains" function redundant --- dist/src/angularjs-dropdown-multiselect.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dist/src/angularjs-dropdown-multiselect.js b/dist/src/angularjs-dropdown-multiselect.js index 0c2029a2..57d3d2a5 100644 --- a/dist/src/angularjs-dropdown-multiselect.js +++ b/dist/src/angularjs-dropdown-multiselect.js @@ -218,7 +218,8 @@ var parentFound = false; while (angular.isDefined(target) && target !== null && !parentFound) { - if (!!target.className.split && contains(target.className.split(' '), 'multiselect-parent') && !parentFound) { + var $target = angular.element(target) + if ($target.hasClass('multiselect-parent') && !parentFound) { if (target === $dropdownTrigger) { parentFound = true; } @@ -659,4 +660,4 @@ /***/ } /******/ ]); -angular.module("angularjs-dropdown-multiselect").run(["$templateCache", function($templateCache) {$templateCache.put("app/component/angularjs-dropdown-multiselect.html","
");}]); \ No newline at end of file +angular.module("angularjs-dropdown-multiselect").run(["$templateCache", function($templateCache) {$templateCache.put("app/component/angularjs-dropdown-multiselect.html","
");}]);