diff options
author | The Flextras Team <jeffry+github@dot-com-it.com> | 2014-05-08 16:03:33 -0400 |
---|---|---|
committer | The Flextras Team <jeffry+github@dot-com-it.com> | 2014-05-08 16:03:33 -0400 |
commit | a29cf8f33f7cfdf179d4d4a493ad25fed5b2c538 (patch) | |
tree | d91abf8e2cedde87ca0b9194a15a6911f73e03ff /angular-multi-select.js | |
parent | db137daf07996936dafa908ac3ba989f67822d44 (diff) | |
download | angular-multi-select-a29cf8f33f7cfdf179d4d4a493ad25fed5b2c538.zip angular-multi-select-a29cf8f33f7cfdf179d4d4a493ad25fed5b2c538.tar.gz angular-multi-select-a29cf8f33f7cfdf179d4d4a493ad25fed5b2c538.tar.bz2 |
Added the ability to execute methdos when the pop up / drop down is open or closed.
Diffstat (limited to 'angular-multi-select.js')
-rw-r--r-- | angular-multi-select.js | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/angular-multi-select.js b/angular-multi-select.js index a2e8eef..fdb1bed 100644 --- a/angular-multi-select.js +++ b/angular-multi-select.js @@ -51,7 +51,10 @@ angular.module( 'multi-select', ['ng'] ).directive( 'multiSelect' , [ '$sce', fu orientation : '@', maxLabels : '@', isDisabled : '=', - directiveId : '@' + directiveId : '@', + // JH DotComIt Added 5/8/2014 + onPopupopen: '&onPopupopen', + onPopupclose: '&onPopupclose' }, template: @@ -235,15 +238,21 @@ angular.module( 'multi-select', ['ng'] ).directive( 'multiSelect' , [ '$sce', fu for( i=0; i < checkboxes.length; i++ ) { if ( i != multiSelectIndex ) { checkboxes[i].className = 'multiSelect checkboxLayer hide'; + // JH DotComIt 5/8/2014 Added method handler for closing the popup + $scope.onPopupclose(); } } if ( checkboxes[ multiSelectIndex ].className == 'multiSelect checkboxLayer hide' ) { checkboxes[ multiSelectIndex ].className = 'multiSelect checkboxLayer show'; + // JH DotComIt 5/8/2014 Added method handler for opening the popup + $scope.onPopupopen(); } else if ( checkboxes[ multiSelectIndex ].className == 'multiSelect checkboxLayer show' ) { checkboxes[ multiSelectIndex ].className = 'multiSelect checkboxLayer hide'; - } + // JH DotComIt 5/8/2014 Added method handler for closing the popup + $scope.onPopupclose(); + } } } @@ -359,8 +368,10 @@ angular.module( 'multi-select', ['ng'] ).directive( 'multiSelect' , [ '$sce', fu var checkboxes = document.querySelectorAll( '.checkboxLayer' ); if ( e.target.className.indexOf( 'multiSelect' ) === -1 ) { for( i=0; i < checkboxes.length; i++ ) { - checkboxes[i].className = 'multiSelect checkboxLayer hide'; - } + checkboxes[i].className = 'multiSelect checkboxLayer hide'; + // JH DotComIt 5/8/2014 Added method handler for closing the popup + $scope.onPopupclose(); + } e.stopPropagation(); } }); |