diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-08-27 18:52:13 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-08-27 18:52:13 +0200 |
commit | c7c2bf214c9cf6bde0c563ee68ffb5b61ed9734e (patch) | |
tree | 0d53bd6049bf05a5ddfae4957d950c124c791679 /js/build | |
parent | 924d8b5d63813a833db3ba86acb438fc7c456bc4 (diff) |
editing
Diffstat (limited to 'js/build')
-rw-r--r-- | js/build/app.js | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/js/build/app.js b/js/build/app.js index a3a749132..c718e3c2c 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -1536,6 +1536,35 @@ var $__build_47_app__ = function () { writable: true }), $__2; }; + app.run([ + '$document', + '$rootScope', + function ($document, $rootScope) { + 'use strict'; + $document.click(function (event) { + $rootScope.$broadcast('documentClicked', event); + }); + } + ]); + app.directive('appNavigationEntryUtils', function () { + 'use strict'; + return { + restrict: 'C', + link: function (scope, elm) { + var menu = elm.siblings('.app-navigation-entry-menu'); + menu.hide(); + var button = $(elm).find('.app-navigation-entry-utils-menu-button button'); + button.click(function () { + menu.toggle(); + }); + scope.$on('documentClicked', function (scope, event) { + if (event.target !== button[0]) { + menu.hide(); + } + }); + } + }; + }); app.directive('newsAudio', function () { 'use strict'; return { @@ -1563,7 +1592,11 @@ var $__build_47_app__ = function () { app.directive('newsAutoFocus', function () { 'use strict'; return function (scope, elem, attrs) { - $(attrs.newsAutofocus).focus(); + if (attrs.newsAutofocus) { + $(attrs.newsAutofocus).focus(); + } else { + elem.focus(); + } }; }); app.directive('newsBindHtmlUnsafe', function () { @@ -1610,11 +1643,12 @@ var $__build_47_app__ = function () { ]); app.directive('newsFocus', [ '$timeout', - function ($timeout) { + '$interpolate', + function ($timeout, $interpolate) { 'use strict'; return function (scope, elem, attrs) { elem.click(function () { - var toReadd = $(attrs.newsFocus); + var toReadd = $($interpolate(attrs.newsFocus)(scope)); $timeout(function () { toReadd.focus(); }, 500); |