diff options
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/apps.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/core/js/apps.js b/core/js/apps.js index 0308d1fef07..5f221bb9826 100644 --- a/core/js/apps.js +++ b/core/js/apps.js @@ -8,10 +8,18 @@ * @copyright Bernhard Posselt 2014 */ -(function (document, $) { +(function (document, $, exports) { 'use strict'; + var dynamicSlideToggleEnabled = false; + + exports.Apps = { + enableDynamicSlideToggle: function () { + dynamicSlideToggleEnabled = true; + } + }; + /** * Provides a way to slide down a target area through a button and slide it * up if the user clicks somewhere else. Used for the news app settings and @@ -22,9 +30,13 @@ * <div class=".slide-area" class="hidden">I'm sliding up</div> */ var registerAppsSlideToggle = function () { + var buttons = $('[data-apps-slide-toggle]'); + $(document).click(function (event) { - var buttons = $('[data-apps-slide-toggle]'); + if (dynamicSlideToggleEnabled) { + buttons = $('[data-apps-slide-toggle]'); + } buttons.each(function (index, button) { @@ -61,4 +73,4 @@ registerAppsSlideToggle(); }); -}(document, jQuery));
\ No newline at end of file +}(document, jQuery, OC));
\ No newline at end of file |