25 lines
733 B
JavaScript
25 lines
733 B
JavaScript
// OwnCloud Click Handling
|
|
// https://doc.owncloud.org/server/8.0/developer_manual/app/css.html
|
|
app.directive('appNavigationEntryUtils', function () {
|
|
'use strict';
|
|
return {
|
|
restrict: 'C',
|
|
link: function (scope, elm) {
|
|
|
|
var menu = elm.siblings('.app-navigation-entry-menu');
|
|
var button = $(elm)
|
|
.find('.app-navigation-entry-utils-menu-button button');
|
|
|
|
button.click(function () {
|
|
menu.toggleClass('open');
|
|
});
|
|
scope.$on('documentClicked', function (scope, event) {
|
|
if (event.target !== button[0]) {
|
|
menu.removeClass('open');
|
|
}
|
|
});
|
|
}
|
|
};
|
|
});
|
|
|