mirror of https://github.com/ColorlibHQ/AdminLTE
commit
6f09c02537
|
@ -528,16 +528,19 @@ function _init() {
|
||||||
$.AdminLTE.boxWidget = {
|
$.AdminLTE.boxWidget = {
|
||||||
selectors: $.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors,
|
selectors: $.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors,
|
||||||
icons: $.AdminLTE.options.boxWidgetOptions.boxWidgetIcons,
|
icons: $.AdminLTE.options.boxWidgetOptions.boxWidgetIcons,
|
||||||
activate: function () {
|
activate: function (_box) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
if (! _box) {
|
||||||
|
_box = document; // activate all boxes per default
|
||||||
|
}
|
||||||
//Listen for collapse event triggers
|
//Listen for collapse event triggers
|
||||||
$(_this.selectors.collapse).on('click', function (e) {
|
$(_box).find(_this.selectors.collapse).on('click', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
_this.collapse($(this));
|
_this.collapse($(this));
|
||||||
});
|
});
|
||||||
|
|
||||||
//Listen for remove event triggers
|
//Listen for remove event triggers
|
||||||
$(_this.selectors.remove).on('click', function (e) {
|
$(_box).find(_this.selectors.remove).on('click', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
_this.remove($(this));
|
_this.remove($(this));
|
||||||
});
|
});
|
||||||
|
@ -656,6 +659,23 @@ function _init() {
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* EXPLICIT BOX ACTIVATION
|
||||||
|
* -----------------------
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* @type plugin
|
||||||
|
* @usage $("#box-widget").activateBox();
|
||||||
|
*/
|
||||||
|
(function ($) {
|
||||||
|
|
||||||
|
$.fn.activateBox = function () {
|
||||||
|
$.AdminLTE.boxWidget.activate(this);
|
||||||
|
};
|
||||||
|
|
||||||
|
})(jQuery);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO LIST CUSTOM PLUGIN
|
* TODO LIST CUSTOM PLUGIN
|
||||||
* -----------------------
|
* -----------------------
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -985,6 +985,13 @@
|
||||||
</div><!-- /.box --></pre>
|
</div><!-- /.box --></pre>
|
||||||
</div><!-- /.col -->
|
</div><!-- /.col -->
|
||||||
</div><!-- /.row -->
|
</div><!-- /.row -->
|
||||||
|
<p>
|
||||||
|
If you inserted a box into the document after <code>app.js</code> was loaded, you have to activate
|
||||||
|
the collapse/remove buttons explicitly by calling <code>.activateBox()</code>:
|
||||||
|
</p>
|
||||||
|
<pre class='prettyprint'><code class='html'><script>
|
||||||
|
$("#box-widget").activateBox();
|
||||||
|
</script></code></pre>
|
||||||
|
|
||||||
<h4>Loading States</h4>
|
<h4>Loading States</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
@ -1355,6 +1355,13 @@ AdminLTE/
|
||||||
</div><!-- /.box --></pre>
|
</div><!-- /.box --></pre>
|
||||||
</div><!-- /.col -->
|
</div><!-- /.col -->
|
||||||
</div><!-- /.row -->
|
</div><!-- /.row -->
|
||||||
|
<p>
|
||||||
|
If you inserted a box into the document after <code>app.js</code> was loaded, you have to activate
|
||||||
|
the collapse/remove buttons explicitly by calling <code>.activateBox()</code>:
|
||||||
|
</p>
|
||||||
|
<pre class='prettyprint'><code class='html'><script>
|
||||||
|
$("#box-widget").activateBox();
|
||||||
|
</script></code></pre>
|
||||||
|
|
||||||
<h4>Loading States</h4>
|
<h4>Loading States</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
Loading…
Reference in New Issue