mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
22 lines
484 B
JavaScript
22 lines
484 B
JavaScript
'use strict';
|
|
|
|
(function(){
|
|
|
|
angular
|
|
.module('habitrpg')
|
|
.directive('expandMenu', expandMenu);
|
|
|
|
function expandMenu() {
|
|
return {
|
|
restrict: 'A',
|
|
link: function($scope, element, attrs) {
|
|
element.on('click', function(event) {
|
|
$scope._expandedMenu = $scope._expandedMenu || {};
|
|
$scope._expandedMenu.menu = ($scope._expandedMenu.menu === attrs.menu) ? null : attrs.menu;
|
|
$scope.$apply()
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}());
|