diff --git a/core/js/apps.js b/core/js/apps.js index 0308d1fef0..5f221bb982 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 @@ *
*/ 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