diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-24 14:28:24 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-24 14:28:24 +0200 |
commit | 9112386cbf0eb1baf28aedd6fce07cef75fa1d68 (patch) | |
tree | 296a2cf8daf0faa9217659ba22b296d10506fce8 /core | |
parent | 8a30fe8ce3b803faaa5b9893b3b060b2027e0fc6 (diff) | |
download | nextcloud-server-9112386cbf0eb1baf28aedd6fce07cef75fa1d68.tar.gz nextcloud-server-9112386cbf0eb1baf28aedd6fce07cef75fa1d68.zip |
query buttons on every click to not worry about weird edge case scenarios
Diffstat (limited to 'core')
-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 |