mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-09 06:01:49 +02:00
New Features
- added notifications - added toggle switches - added delete feature - added email verification
This commit is contained in:
parent
e61ef151f6
commit
1b20a11bba
91 changed files with 6859 additions and 2756 deletions
27
public/js/directives/dropdown.directive.js
Normal file
27
public/js/directives/dropdown.directive.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
angular.module('rallly')
|
||||
.directive('dropdown', function($document){
|
||||
return {
|
||||
restrict : 'A',
|
||||
link : function(scope, el, attrs){
|
||||
el.addClass('dropdown');
|
||||
scope.open = false;
|
||||
|
||||
var clickHandler = function(event){
|
||||
var isClickedElementChildOfPopup = el.find(event.target).length > 0;
|
||||
if (isClickedElementChildOfPopup) return;
|
||||
scope.toggle();
|
||||
}
|
||||
|
||||
scope.toggle = function(){
|
||||
scope.open = !scope.open;
|
||||
if (scope.open){
|
||||
el.addClass('open');
|
||||
$document.bind('click', clickHandler);
|
||||
} else {
|
||||
el.removeClass('open');
|
||||
$document.unbind('click', clickHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue