From f6593b34d2569c1c7d27ada5852dadd49dd8fce4 Mon Sep 17 00:00:00 2001 From: simivar Date: Mon, 21 Sep 2015 14:41:29 +0200 Subject: [PATCH] methods to toggle/remove boxes --- dist/js/app.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/dist/js/app.js b/dist/js/app.js index 21ad38041..b61d6cea8 100644 --- a/dist/js/app.js +++ b/dist/js/app.js @@ -672,14 +672,16 @@ function _init() { })(jQuery); -/* - * EXPLICIT BOX ACTIVATION + /* + * EXPLICIT BOX CONTROLS * ----------------------- * This is a custom plugin to use with the component BOX. It allows you to activate - * a box inserted in the DOM after the app.js was loaded. + * a box inserted in the DOM after the app.js was loaded, toggle and remove box. * * @type plugin * @usage $("#box-widget").activateBox(); + * @usage $("#box-widget").toggleBox(); + * @usage $("#box-widget").removeBox(); */ (function ($) { @@ -688,6 +690,16 @@ function _init() { $.fn.activateBox = function () { $.AdminLTE.boxWidget.activate(this); }; + + $.fn.toggleBox = function(){ + var button = $($.AdminLTE.boxWidget.selectors.collapse, this); + $.AdminLTE.boxWidget.collapse(button); + }; + + $.fn.removeBox = function(){ + var button = $($.AdminLTE.boxWidget.selectors.remove, this); + $.AdminLTE.boxWidget.remove(button); + }; })(jQuery); @@ -743,4 +755,4 @@ function _init() { } }); }; -}(jQuery)); \ No newline at end of file +}(jQuery));