diff options
author | Steven <isteven@users.noreply.github.com> | 2014-05-09 07:24:30 +0800 |
---|---|---|
committer | Steven <isteven@users.noreply.github.com> | 2014-05-09 07:24:30 +0800 |
commit | 32820f96cb650aad40fbbdf41ee82943a58375ec (patch) | |
tree | d91abf8e2cedde87ca0b9194a15a6911f73e03ff | |
parent | db137daf07996936dafa908ac3ba989f67822d44 (diff) | |
parent | a29cf8f33f7cfdf179d4d4a493ad25fed5b2c538 (diff) | |
download | angular-multi-select-32820f96cb650aad40fbbdf41ee82943a58375ec.zip angular-multi-select-32820f96cb650aad40fbbdf41ee82943a58375ec.tar.gz angular-multi-select-32820f96cb650aad40fbbdf41ee82943a58375ec.tar.bz2 |
Merge pull request #5 from Reboog711/master
Added the ability to execute methods when the drop down is opened or closed
-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(); } }); |