Skip to content

Commit 4d3c509

Browse files
author
isteven
committed
fixed click listener on single selection mode
1 parent 540426c commit 4d3c509

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

angular-multi-select.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,12 @@ angular.module( 'multi-select', ['ng'] ).directive( 'multiSelect' , [ '$sce', '$
521521
// UI operations to show/hide checkboxes based on click event..
522522
$scope.toggleCheckboxes = function( e ) {
523523

524+
// We grab the checkboxLayer
525+
$scope.checkBoxLayer = element.children()[1];
526+
527+
// We grab the button
528+
clickedEl = element.children()[0];
529+
524530
// Just to make sure.. had a bug where key events were recorded twice
525531
angular.element( document ).unbind( 'click', $scope.externalClickListener );
526532
angular.element( window ).unbind( 'keydown', $scope.keyboardListener );
@@ -542,9 +548,7 @@ angular.module( 'multi-select', ['ng'] ).directive( 'multiSelect' , [ '$sce', '$
542548
// close callback
543549
$scope.onClose( { data: element } );
544550
return true;
545-
}
546-
547-
$scope.checkBoxLayer = angular.element( element ).children()[1];
551+
}
548552

549553
// The idea below was taken from another multi-select directive - https://github.com/amitava82/angular-multiselect
550554
// His version is awesome if you need a more simple multi-select approach.

0 commit comments

Comments
 (0)