Browse Source

Merge pull request #53 from wenzhixin/master

Update my repo
Dennis Hernández 10 years ago
parent
commit
86a40c7e8e
2 changed files with 23 additions and 16 deletions
  1. 16 11
      docs/_i18n/en/documentation/table-options.md
  2. 7 5
      src/bootstrap-table.js

+ 16 - 11
docs/_i18n/en/documentation/table-options.md

@@ -2,7 +2,7 @@
 
 
 ---
 ---
 
 
-The table options is defined in `jQuery.fn.bootstrapTable.defaults`.
+The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
 
 
 <table class="table"
 <table class="table"
        data-toggle="table"
        data-toggle="table"
@@ -81,11 +81,16 @@ The table options is defined in `jQuery.fn.bootstrapTable.defaults`.
         <td>data-icons</td>
         <td>data-icons</td>
         <td>Object</td>
         <td>Object</td>
         <td>{<br/>
         <td>{<br/>
-        &nbsp;&nbsp;refresh: 'glyphicon-refresh icon-refresh',<br/>
-        &nbsp;&nbsp;toggle: 'glyphicon-list-alt icon-list-alt',<br/>
-        &nbsp;&nbsp;columns: 'glyphicon-th icon-th'<br/>
-        }</td>
-        <td>Defines icons that used for refresh, toggle and columns buttons</td>
+        &nbsp;&nbsp;<i>paginationSwitchDown:</i> 'glyphicon-collapse-down icon-chevron-down',<br/>
+        &nbsp;&nbsp;<i>paginationSwitchUp:</i> 'glyphicon-collapse-up icon-chevron-up',<br/>
+        &nbsp;&nbsp;<i>refresh:</i> 'glyphicon-refresh icon-refresh',<br/>
+        &nbsp;&nbsp;<i>toggle:</i> 'glyphicon-list-alt icon-list-alt',<br/>
+        &nbsp;&nbsp;<i>columns:</i> 'glyphicon-th icon-th',<br/>
+        &nbsp;&nbsp;<i>detailOpen:</i> 'glyphicon-plus icon-plus',<br/>
+        &nbsp;&nbsp;<i>detailClose:</i> 'glyphicon-minus icon-minus'<br/>
+        }
+        </td>
+        <td>Defines icons used in the toolbar, pagination, and details view.</td>
     </tr>
     </tr>
     <tr>
     <tr>
         <td>columns</td>
         <td>columns</td>
@@ -307,7 +312,7 @@ The table options is defined in `jQuery.fn.bootstrapTable.defaults`.
         <td>data-minimum-count-columns</td>
         <td>data-minimum-count-columns</td>
         <td>Number</td>
         <td>Number</td>
         <td>1</td>
         <td>1</td>
-        <td>The minimum count columns to hide of the columns drop down list.
+        <td>The minimum number of columns to hide from the columns drop down list.
         </td>
         </td>
     </tr>
     </tr>
     <tr>
     <tr>
@@ -420,7 +425,7 @@ The table options is defined in `jQuery.fn.bootstrapTable.defaults`.
         <td>data-click-to-select</td>
         <td>data-click-to-select</td>
         <td>Boolean</td>
         <td>Boolean</td>
         <td>false</td>
         <td>false</td>
-        <td>True to select checkbox or radiobox when click rows.</td>
+        <td>True to select checkbox or radiobox when clicking rows.</td>
     </tr>
     </tr>
     <tr>
     <tr>
         <td>singleSelect</td>
         <td>singleSelect</td>
@@ -435,7 +440,7 @@ The table options is defined in `jQuery.fn.bootstrapTable.defaults`.
         <td>String</td>
         <td>String</td>
         <td>undefined</td>
         <td>undefined</td>
         <td>
         <td>
-        A jQuery selector that indicate the toolbar, for example:<br>
+        A jQuery selector that indicates the toolbar, for example:<br>
         #toolbar, .toolbar.
         #toolbar, .toolbar.
         </td>
         </td>
     </tr>
     </tr>
@@ -466,7 +471,7 @@ The table options is defined in `jQuery.fn.bootstrapTable.defaults`.
         <td>Function</td>
         <td>Function</td>
         <td>{}</td>
         <td>{}</td>
         <td>
         <td>
-        The row style formatter function, take two parameters: <br>
+        The row style formatter function, takes two parameters: <br>
         row: the row record data.<br>
         row: the row record data.<br>
         index: the row index.<br>
         index: the row index.<br>
         Support classes or css.
         Support classes or css.
@@ -478,7 +483,7 @@ The table options is defined in `jQuery.fn.bootstrapTable.defaults`.
         <td>Function</td>
         <td>Function</td>
         <td>{}</td>
         <td>{}</td>
         <td>
         <td>
-        The row attribute formatter function, take two parameters: <br>
+        The row attribute formatter function, takes two parameters: <br>
         row: the row record data.<br>
         row: the row record data.<br>
         index: the row index.<br>
         index: the row index.<br>
         Support all custom attributes.
         Support all custom attributes.

+ 7 - 5
src/bootstrap-table.js

@@ -255,7 +255,9 @@
             paginationSwitchUp: 'glyphicon-collapse-up icon-chevron-up',
             paginationSwitchUp: 'glyphicon-collapse-up icon-chevron-up',
             refresh: 'glyphicon-refresh icon-refresh',
             refresh: 'glyphicon-refresh icon-refresh',
             toggle: 'glyphicon-list-alt icon-list-alt',
             toggle: 'glyphicon-list-alt icon-list-alt',
-            columns: 'glyphicon-th icon-th'
+            columns: 'glyphicon-th icon-th',
+            detailOpen: 'glyphicon-plus icon-plus',
+            detailClose: 'glyphicon-minus icon-minus'
         },
         },
 
 
         rowStyle: function (row, index) {
         rowStyle: function (row, index) {
@@ -1301,7 +1303,7 @@
             if (!this.options.cardView && this.options.detailView) {
             if (!this.options.cardView && this.options.detailView) {
                 html.push('<td>',
                 html.push('<td>',
                     '<a class="detail-icon" href="javascript:">',
                     '<a class="detail-icon" href="javascript:">',
-                    '<i class="glyphicon glyphicon-plus icon-plus"></i>',
+                    sprintf('<i class="%s %s"></i>', this.options.iconsPrefix, this.options.icons.detailOpen),
                     '</a>',
                     '</a>',
                     '</td>');
                     '</td>');
             }
             }
@@ -1457,11 +1459,11 @@
 
 
             // remove and update
             // remove and update
             if ($tr.next().is('tr.detail-view')) {
             if ($tr.next().is('tr.detail-view')) {
-                $this.find('i').attr('class', 'glyphicon glyphicon-plus icon-plus');
+                $this.find('i').attr('class', sprintf('%s %s', that.options.iconsPrefix, that.options.icons.detailOpen));
                 $tr.next().remove();
                 $tr.next().remove();
                 that.trigger('collapse-row', index, row);
                 that.trigger('collapse-row', index, row);
             } else {
             } else {
-                $this.find('i').attr('class', 'glyphicon glyphicon-minus icon-minus');
+                $this.find('i').attr('class', sprintf('%s %s', that.options.iconsPrefix, that.options.icons.detailClose));
                 $tr.after(sprintf('<tr class="detail-view"><td colspan="%s">%s</td></tr>',
                 $tr.after(sprintf('<tr class="detail-view"><td colspan="%s">%s</td></tr>',
                     $tr.find('td').length, calculateObjectValue(that.options,
                     $tr.find('td').length, calculateObjectValue(that.options,
                         that.options.detailFormatter, [index, row], '')));
                         that.options.detailFormatter, [index, row], '')));
@@ -1680,7 +1682,7 @@
         this.$selectAll_ = this.$header_.find('[name="btSelectAll"]');
         this.$selectAll_ = this.$header_.find('[name="btSelectAll"]');
         this.$tableHeader.css({
         this.$tableHeader.css({
             'margin-right': scrollWidth
             'margin-right': scrollWidth
-        }).find('table').css('width', this.$el.css('width'))
+        }).find('table').css('width', this.$el.outerWidth())
             .html('').attr('class', this.$el.attr('class'))
             .html('').attr('class', this.$el.attr('class'))
             .append(this.$header_);
             .append(this.$header_);