Skip to content

Commit

Permalink
fix batch actions directive to work without jQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
ThieryMichel committed Mar 31, 2015
1 parent 8f769f4 commit 09c119f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/javascripts/ng-admin/Crud/misc/ViewBatchActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ define(function (require) {
},
template: viewActionsTemplate,
link: function(scope) {

scope.isopen = false;

scope.toggleDropdown = function($event) {
$event.preventDefault();
$event.stopPropagation();
scope.isopen = !scope.isopen;
};

scope.buttons = scope.buttons();
if (typeof scope.buttons === 'string') {
scope.customTemplate = scope.buttons;
Expand Down
4 changes: 2 additions & 2 deletions src/javascripts/ng-admin/Crud/misc/view-batch-actions.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<span class="btn-group">
<button type="button" ng-disabled="!selection.length" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="btn-group" dropdown is-open="isopen">
<button type="button" ng-disabled="!selection.length" class="btn btn-default dropdown-toggle" dropdown-toggle >
{{ selection.length }} Selected <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
Expand Down

0 comments on commit 09c119f

Please sign in to comment.