Browse Source

Format the code and add mobile docs.

zhixin 10 years ago
parent
commit
d2765833d8

+ 35 - 0
docs/_i18n/en/extensions/mobile.md

@@ -0,0 +1,35 @@
+# Table Mobile
+
+Use Plugin: [bootstrap-table-mobile](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/mobile)
+
+## Usage
+
+```html
+<script src="extensions/mobile/bootstrap-table-mobile.js"></script>
+```
+
+## Options
+
+### mobileResponsive
+
+* type: Boolean
+* description: Set true to change the view between card and table view depending on width and height given.
+* default: `false`
+
+### checkOnInit
+
+* type: Boolean
+* description: Set true to check the window size on init.
+* default: `false`
+
+### minWidth
+
+* type: Integer
+* description: Set the minimum width when the table will change the view.
+* default: `562`
+
+### minHeight
+
+* type: Integer
+* description: Set the minimum height when the table will change the view.
+* default: `562`

+ 35 - 0
docs/_i18n/es/extensions/mobile.md

@@ -0,0 +1,35 @@
+# Table Mobile
+
+Use Plugin: [bootstrap-table-mobile](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/mobile)
+
+## Usage
+
+```html
+<script src="extensions/mobile/bootstrap-table-mobile.js"></script>
+```
+
+## Options
+
+### mobileResponsive
+
+* type: Boolean
+* description: Set true to change the view between card and table view depending on width and height given.
+* default: `false`
+
+### checkOnInit
+
+* type: Boolean
+* description: Set true to check the window size on init.
+* default: `false`
+
+### minWidth
+
+* type: Integer
+* description: Set the minimum width when the table will change the view.
+* default: `562`
+
+### minHeight
+
+* type: Integer
+* description: Set the minimum height when the table will change the view.
+* default: `562`

+ 35 - 0
docs/_i18n/zh-cn/extensions/mobile.md

@@ -0,0 +1,35 @@
+# Table Mobile
+
+Use Plugin: [bootstrap-table-mobile](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/mobile)
+
+## Usage
+
+```html
+<script src="extensions/mobile/bootstrap-table-mobile.js"></script>
+```
+
+## Options
+
+### mobileResponsive
+
+* type: Boolean
+* description: Set true to change the view between card and table view depending on width and height given.
+* default: `false`
+
+### checkOnInit
+
+* type: Boolean
+* description: Set true to check the window size on init.
+* default: `false`
+
+### minWidth
+
+* type: Integer
+* description: Set the minimum width when the table will change the view.
+* default: `562`
+
+### minHeight
+
+* type: Integer
+* description: Set the minimum height when the table will change the view.
+* default: `562`

+ 3 - 3
src/extensions/mobile/bootstrap-table-mobile.js

@@ -14,10 +14,10 @@
         if (el.options.height || el.options.showFooter) {
             setTimeout(el.resetView(), 1);
         }
-    }
+    };
 
     var changeView = function (el, width, height) {
-        if(width <= el.options.minWidth && height <= el.options.minHeight){
+        if (width <= el.options.minWidth && height <= el.options.minHeight) {
             if (!toggled) {
                 el.toggleView();
                 toggled = true;
@@ -30,7 +30,7 @@
         }
 
         resetView(el);
-    }
+    };
 
     $.extend($.fn.bootstrapTable.defaults, {
         mobileResponsive: false,