Skip to content

Commit ef8624b

Browse files
committed
Merge pull request ColorlibHQ#697 from simivar/master
methods to toggle/remove boxes
2 parents 0dad027 + f6593b3 commit ef8624b

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

dist/js/app.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -672,14 +672,16 @@ function _init() {
672672

673673
})(jQuery);
674674

675-
/*
676-
* EXPLICIT BOX ACTIVATION
675+
/*
676+
* EXPLICIT BOX CONTROLS
677677
* -----------------------
678678
* This is a custom plugin to use with the component BOX. It allows you to activate
679-
* a box inserted in the DOM after the app.js was loaded.
679+
* a box inserted in the DOM after the app.js was loaded, toggle and remove box.
680680
*
681681
* @type plugin
682682
* @usage $("#box-widget").activateBox();
683+
* @usage $("#box-widget").toggleBox();
684+
* @usage $("#box-widget").removeBox();
683685
*/
684686
(function ($) {
685687

@@ -688,6 +690,16 @@ function _init() {
688690
$.fn.activateBox = function () {
689691
$.AdminLTE.boxWidget.activate(this);
690692
};
693+
694+
$.fn.toggleBox = function(){
695+
var button = $($.AdminLTE.boxWidget.selectors.collapse, this);
696+
$.AdminLTE.boxWidget.collapse(button);
697+
};
698+
699+
$.fn.removeBox = function(){
700+
var button = $($.AdminLTE.boxWidget.selectors.remove, this);
701+
$.AdminLTE.boxWidget.remove(button);
702+
};
691703

692704
})(jQuery);
693705

@@ -743,4 +755,4 @@ function _init() {
743755
}
744756
});
745757
};
746-
}(jQuery));
758+
}(jQuery));

0 commit comments

Comments
 (0)