From e1c12f7ba39681c794b2951b77e6a676c0e25ee0 Mon Sep 17 00:00:00 2001 From: Eddie Monge Date: Fri, 12 Sep 2014 16:33:37 -0700 Subject: [PATCH] removed spaces used as indentation inside of strings, switched to using single quotes, removed unneeded variable and return --- angular-dropdowns.js | 81 +++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/angular-dropdowns.js b/angular-dropdowns.js index f03d0a6..604b5ac 100644 --- a/angular-dropdowns.js +++ b/angular-dropdowns.js @@ -40,16 +40,18 @@ dd.directive('dropdownSelect', ['DropdownService', '$window', }); }], - template: "
" + - " {{dropdownModel[labelField]}}" + - " " + - "
" + template: [ + '
', + '{{dropdownModel[labelField]}}', + '', + '
' + ].join('') }; } ]); @@ -73,29 +75,22 @@ dd.directive('dropdownSelectItem', [ }; }, - template: "
  • " + - " " + - " {{dropdownSelectItem[dropdownItemLabel]}}" + - " " + - "
  • " + template: [ + '
  • ', + '', + '{{dropdownSelectItem[dropdownItemLabel]}}', + '', + '
  • ' + ].join('') }; } ]); dd.directive('dropdownMenu', ['$parse', '$compile', 'DropdownService', '$window', function ($parse, $compile, DropdownService, $window) { - - var template = ""; - return { restrict: 'A', replace: false, @@ -109,12 +104,20 @@ dd.directive('dropdownMenu', ['$parse', '$compile', 'DropdownService', '$window' $scope.labelField = $attrs.dropdownItemLabel || 'text'; var $clickEvent = ('ontouchstart' in $window ? 'touchend' : 'click'); - var $template = angular.element(template); + var $template = angular.element([ + '' + ].join('')); // Attach this controller to the element's data $template.data('$dropdownMenuController', this); var tpl = $compile($template)($scope); - var $wrap = angular.element("
    "); + var $wrap = angular.element('
    '); $element.replaceWith($wrap); $wrap.append($element); @@ -163,14 +166,16 @@ dd.directive('dropdownMenuItem', [ }; }, - template: "
  • " + - " " + - " {{dropdownMenuItem[dropdownItemLabel]}}" + - " " + - "
  • " + template: [ + '
  • ', + '', + '{{dropdownMenuItem[dropdownItemLabel]}}', + '', + '
  • ' + ].join('') }; } ]); @@ -182,7 +187,7 @@ dd.factory('DropdownService', ['$document', _dropdowns = []; body.bind('click', function () { - return angular.forEach(_dropdowns, function (el) { + angular.forEach(_dropdowns, function (el) { el.removeClass('active'); }); });