Browse Source

fixed Layout('init') for external use

REJack 5 years ago
parent
commit
2473021861
5 changed files with 9 additions and 5 deletions
  1. 3 3
      build/js/Layout.js
  2. 6 2
      dist/js/adminlte.js
  3. 0 0
      dist/js/adminlte.js.map
  4. 0 0
      dist/js/adminlte.min.js
  5. 0 0
      dist/js/adminlte.min.js.map

+ 3 - 3
build/js/Layout.js

@@ -166,7 +166,7 @@ const Layout = (($) => {
 
     // Static
 
-    static _jQueryInterface(config) {
+    static _jQueryInterface(config = '') {
       return this.each(function () {
         let data = $(this).data(DATA_KEY)
         const _options = $.extend({}, Default, $(this).data())
@@ -176,8 +176,8 @@ const Layout = (($) => {
           $(this).data(DATA_KEY, data)
         }
 
-        if (config === 'init') {
-          data[config]()
+        if (config === 'init' || config === '') {
+          data['_init']()
         }
       })
     }

+ 6 - 2
dist/js/adminlte.js

@@ -435,6 +435,10 @@
       ;
 
       Layout._jQueryInterface = function _jQueryInterface(config) {
+        if (config === void 0) {
+          config = '';
+        }
+
         return this.each(function () {
           var data = $(this).data(DATA_KEY);
 
@@ -445,8 +449,8 @@
             $(this).data(DATA_KEY, data);
           }
 
-          if (config === 'init') {
-            data[config]();
+          if (config === 'init' || config === '') {
+            data['_init']();
           }
         });
       };

File diff suppressed because it is too large
+ 0 - 0
dist/js/adminlte.js.map


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


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


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