diff options
Diffstat (limited to 'core/js/app.js')
-rw-r--r-- | core/js/app.js | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/core/js/app.js b/core/js/app.js index 17fc225089e..0308d1fef07 100644 --- a/core/js/app.js +++ b/core/js/app.js @@ -7,23 +7,10 @@ * @author Bernhard Posselt <dev@bernhard-posselt.com> * @copyright Bernhard Posselt 2014 */ -(function (document, $, exports) { - 'use strict'; - - var buttons = $(); - - /** - * Allow apps to register buttons at runtime to not impact performance - * negatively on document click - * @param $ button wrapped in jquery result - */ - exports.App = { - registerSlideToggleButton: function (button) { - buttons = buttons.add(button); - } - }; +(function (document, $) { + 'use strict'; /** * Provides a way to slide down a target area through a button and slide it @@ -35,11 +22,10 @@ * <div class=".slide-area" class="hidden">I'm sliding up</div> */ var registerAppsSlideToggle = function () { - // use only buttons that are already in the dom - buttons = buttons.add($('[data-apps-slide-toggle]')); - $(document).click(function (event) { + var buttons = $('[data-apps-slide-toggle]'); + buttons.each(function (index, button) { var areaSelector = $(button).data('apps-slide-toggle'); @@ -75,4 +61,4 @@ registerAppsSlideToggle(); }); -}(document, jQuery, OC));
\ No newline at end of file +}(document, jQuery));
\ No newline at end of file |