Browse Source

Updating from master

Abdullah Almsaeed 9 years ago
parent
commit
fa75a8d3b0
4 changed files with 40 additions and 2 deletions
  1. 26 2
      dist/js/app.js
  2. 0 0
      dist/js/app.min.js
  3. 7 0
      documentation/build/include/components.html
  4. 7 0
      documentation/index.html

+ 26 - 2
dist/js/app.js

@@ -532,17 +532,24 @@ function _init() {
   $.AdminLTE.boxWidget = {
     selectors: $.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors,
     icons: $.AdminLTE.options.boxWidgetOptions.boxWidgetIcons,
+<<<<<<< HEAD
     animationSpeed: $.AdminLTE.options.animationSpeed,
     activate: function () {
+=======
+    activate: function (_box) {
+>>>>>>> refs/remotes/origin/master
       var _this = this;
+      if (! _box) {
+        _box = document; // activate all boxes per default
+      }
       //Listen for collapse event triggers
-      $(_this.selectors.collapse).on('click', function (e) {
+      $(_box).find(_this.selectors.collapse).on('click', function (e) {
         e.preventDefault();
         _this.collapse($(this));
       });
 
       //Listen for remove event triggers
-      $(_this.selectors.remove).on('click', function (e) {
+      $(_box).find(_this.selectors.remove).on('click', function (e) {
         e.preventDefault();
         _this.remove($(this));
       });
@@ -661,6 +668,23 @@ function _init() {
 
 })(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
  * -----------------------

File diff suppressed because it is too large
+ 0 - 0
dist/js/app.min.js


+ 7 - 0
documentation/build/include/components.html

@@ -985,6 +985,13 @@
 &LT;/div>&LT;!-- /.box --></pre>
     </div><!-- /.col -->
   </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'>&LT;script>
+    $("#box-widget").activateBox();
+&LT;/script></code></pre>
 
   <h4>Loading States</h4>
   <div class="row">

+ 7 - 0
documentation/index.html

@@ -1355,6 +1355,13 @@ AdminLTE/
 &LT;/div>&LT;!-- /.box --></pre>
     </div><!-- /.col -->
   </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'>&LT;script>
+    $("#box-widget").activateBox();
+&LT;/script></code></pre>
 
   <h4>Loading States</h4>
   <div class="row">

Some files were not shown because too many files changed in this diff