Skip to content

Commit

Permalink
add wrap element to templateCache, closes #68
Browse files Browse the repository at this point in the history
  • Loading branch information
jseppi committed Dec 14, 2015
1 parent 662b170 commit 871c6f0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
7 changes: 5 additions & 2 deletions angular-dropdowns.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
'</li>'
].join(''));

$templateCache.put('ngDropdowns/templates/dropdownMenuWrap.html',
'<div class="wrap-dd-menu" ng-class="{\'disabled\': dropdownDisabled}"></div>'
);
}]);

dd.directive('dropdownSelect', ['DropdownService',
Expand Down Expand Up @@ -149,8 +152,8 @@
$template.data('$dropdownMenuController', this);

var tpl = $compile($template)($scope);
var $wrap = $compile(angular.element(
'<div class="wrap-dd-menu" ng-class="{\'disabled\': dropdownDisabled}"></div>')
var $wrap = $compile(
angular.element($templateCache.get('ngDropdowns/templates/dropdownMenuWrap.html'))
)($scope);

$element.replaceWith($wrap);
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-dropdowns",
"version": "1.5.0",
"version": "1.5.1",
"homepage": "https://github.com/jseppi/angular-dropdowns",
"authors": [
"James Seppi <[email protected]> (http://github.com/jseppi)",
Expand Down
7 changes: 5 additions & 2 deletions dist/angular-dropdowns.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
'</li>'
].join(''));

$templateCache.put('ngDropdowns/templates/dropdownMenuWrap.html',
'<div class="wrap-dd-menu" ng-class="{\'disabled\': dropdownDisabled}"></div>'
);
}]);

dd.directive('dropdownSelect', ['DropdownService',
Expand Down Expand Up @@ -149,8 +152,8 @@
$template.data('$dropdownMenuController', this);

var tpl = $compile($template)($scope);
var $wrap = $compile(angular.element(
'<div class="wrap-dd-menu" ng-class="{\'disabled\': dropdownDisabled}"></div>')
var $wrap = $compile(
angular.element($templateCache.get('ngDropdowns/templates/dropdownMenuWrap.html'))
)($scope);

$element.replaceWith($wrap);
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-dropdowns.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-dropdowns",
"version": "1.5.0",
"version": "1.5.1",
"author": {
"name": "James Seppi",
"email": "[email protected]",
Expand Down

0 comments on commit 871c6f0

Please sign in to comment.