From d9402cebf17b3aa737b83f36efd93da916dd44ba Mon Sep 17 00:00:00 2001 From: Shemesh Date: Wed, 16 Sep 2015 13:57:12 +0300 Subject: [PATCH] update the code to not use the deprecated tooltip-html-unsafe updated the code to not use the deprecated tooltip-html-unsafe --- angular-ui-tab-scroll.js | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/angular-ui-tab-scroll.js b/angular-ui-tab-scroll.js index 7cba091..0848725 100644 --- a/angular-ui-tab-scroll.js +++ b/angular-ui-tab-scroll.js @@ -52,8 +52,8 @@ angular.module('ui.tab.scroll', []) } ) .directive('scrollableTabset', [ - 'scrollableTabsetConfig', '$window', '$interval', '$timeout', - function(scrollableTabsetConfig, $window, $interval, $timeout) { + 'scrollableTabsetConfig', '$window', '$interval', '$timeout','$sce', + function(scrollableTabsetConfig, $window, $interval, $timeout, $sce) { var timeoutId = null; @@ -112,11 +112,11 @@ angular.module('ui.tab.scroll', []) template: [ '
', - '', '
', - '', '
' @@ -124,25 +124,19 @@ angular.module('ui.tab.scroll', []) link: function($scope, $el) { - $scope.toTheLeftHTML = ''; - $scope.toTheRightHTML = ''; + $scope.tooltipRightHtml = ''; + $scope.tooltipLeftHtml = ''; + var toTheLeftHTML = ''; + var toTheRightHTML = ''; var showTooltips = angular.isDefined($scope.showTooltips)? $scope.showTooltips : scrollableTabsetConfig.showTooltips; $scope.disableLeft = function() { - return !$scope.toTheLeftHTML; + return !toTheLeftHTML; }; $scope.disableRight = function() { - return !$scope.toTheRightHTML; - }; - - $scope.tooltipLeftContent = function() { - return showTooltips ? $scope.toTheLeftHTML : ''; - }; - - $scope.tooltipRightContent = function() { - return showTooltips ? $scope.toTheRightHTML : ''; + return !toTheRightHTML; }; $scope.tooltipLeftDirection = function() { @@ -184,7 +178,8 @@ angular.module('ui.tab.scroll', []) }); - $scope.toTheLeftHTML = nodes.join('
'); + toTheLeftHTML = nodes.join('
'); + $scope.tooltipLeftHtml = showTooltips ? $sce.trustAsHtml(toTheLeftHTML) : ''; }; $scope.toTheRight = function() { @@ -206,7 +201,8 @@ angular.module('ui.tab.scroll', []) }); - $scope.toTheRightHTML = nodes.join('
'); + toTheRightHTML = nodes.join('
'); + $scope.tooltipRightHtml = showTooltips ? $sce.trustAsHtml(toTheRightHTML) : ''; }; $scope.recalcSides = function() {