Browse Source

Update change log and format the code.

zhixin 10 years ago
parent
commit
fdb0daf3fe
2 changed files with 53 additions and 38 deletions
  1. 16 1
      CHANGELOG.md
  2. 37 37
      src/bootstrap-table.js

+ 16 - 1
CHANGELOG.md

@@ -1,6 +1,6 @@
 ## ChangeLog
 
-### 1.8.2
+### 1.9.0
 
 - [enh] Update bootstrap-table-cookie.js.
 - [enh] Use options for detailView's open/close icons.
@@ -11,6 +11,21 @@
 - [bug] Fix #938, fix #940: Multiple Sort and Hide/Show column.
 - [bug] Fix #970: click and dblclick bug on no-rows table.
 - [bug] Fix #967: unselected column while column sorted display error.
+- [enh] Support title feature in cells.
+- [enh] Improved cookie, mobile extension.
+- [enh] Added groupby, angular extension.
+- [enh] Added option for setting locale.
+- [enh] Added `exportDataType` option for export extension.
+- [enh] Add fa-IR, ca-ES, es-ES, et-EE and af-ZA locales.
+- [enh] Supported complex header with rowspans and colspans.
+- [enh] Added `searchFomatter` column option.
+- [bug] Fixed ResetRow function and undefined column search bug.
+- [bug] Fixed #639: footer resizing problem.
+- [enh] Added resetSearch method to reset the search text.
+- [enh] Supported flat json.
+- [enh] Improved reorder-columns extension.
+- [enh] Added multiple-search, accent-neutralise extension.
+- [enh] Added fixed-columns extension.
 
 ### 1.8.1
 

+ 37 - 37
src/bootstrap-table.js

@@ -4,7 +4,7 @@
  * https://github.com/wenzhixin/bootstrap-table/
  */
 
-! function ($) {
+!function ($) {
     'use strict';
 
     // TOOLS DEFINITION
@@ -95,7 +95,7 @@
                 }
             }
         }
-    }
+    };
 
     var getScrollBarWidth = function () {
         if (cachedWidth === null) {
@@ -210,11 +210,11 @@
 
         return dataAttr;
     };
-    
+
     var getItemField = function (item, field) {
         var props = field.split('.');
         var value = item;
-        for(var p in props) {
+        for (var p in props) {
             value = value[props[p]];
         }
         return value;
@@ -524,26 +524,26 @@
             }
         }
     };
-    
+
     BootstrapTable.prototype.initContainer = function () {
         this.$container = $([
             '<div class="bootstrap-table">',
-                '<div class="fixed-table-toolbar"></div>',
-                    this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ?
-                    '<div class="fixed-table-pagination" style="clear: both;"></div>' :
-                    '',
-                '<div class="fixed-table-container">',
-                '<div class="fixed-table-header"><table></table></div>',
-                '<div class="fixed-table-body">',
-                    '<div class="fixed-table-loading">',
-                        this.options.formatLoadingMessage(),
-                    '</div>',
-                '</div>',
-                '<div class="fixed-table-footer"><table><tr></tr></table></div>',
-                this.options.paginationVAlign === 'bottom' || this.options.paginationVAlign === 'both' ?
+            '<div class="fixed-table-toolbar"></div>',
+            this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ?
+                '<div class="fixed-table-pagination" style="clear: both;"></div>' :
+                '',
+            '<div class="fixed-table-container">',
+            '<div class="fixed-table-header"><table></table></div>',
+            '<div class="fixed-table-body">',
+            '<div class="fixed-table-loading">',
+            this.options.formatLoadingMessage(),
+            '</div>',
+            '</div>',
+            '<div class="fixed-table-footer"><table><tr></tr></table></div>',
+            this.options.paginationVAlign === 'bottom' || this.options.paginationVAlign === 'both' ?
                 '<div class="fixed-table-pagination"></div>' :
                 '',
-                '</div>',
+            '</div>',
             '</div>'
         ].join(''));
 
@@ -714,8 +714,8 @@
 
                 html.push('<th' + sprintf(' title="%s"', column.titleTooltip),
                     column.checkbox || column.radio ?
-                    sprintf(' class="bs-checkbox %s"', column['class'] || '') :
-                    class_,
+                        sprintf(' class="bs-checkbox %s"', column['class'] || '') :
+                        class_,
                     sprintf(' style="%s"', halign + style),
                     sprintf(' rowspan="%s"', column.rowspan),
                     sprintf(' colspan="%s"', column.colspan),
@@ -762,7 +762,7 @@
         this.$header.children().children().off('keypress').on('keypress', function (event) {
             if (that.options.sortable && $(this).data().sortable) {
                 var code = event.keyCode || event.which;
-                if(code == 13) { //Enter keycode
+                if (code == 13) { //Enter keycode
                     that.onSort(event);
                 }
             }
@@ -1103,7 +1103,7 @@
                             }
                         } else {
                             if ((value + '').toLowerCase().indexOf(s) !== -1) {
-                               return true;
+                                return true;
                             }
                         }
                     }
@@ -1176,10 +1176,10 @@
         var pageNumber = [
                 sprintf('<span class="btn-group %s">',
                     this.options.paginationVAlign === 'top' || this.options.paginationVAlign === 'both' ?
-                    'dropdown' : 'dropup'),
+                        'dropdown' : 'dropup'),
                 '<button type="button" class="btn btn-default ' +
-                    (this.options.iconSize === undefined ? '' : ' btn-' + this.options.iconSize) +
-                    ' dropdown-toggle" data-toggle="dropdown">',
+                (this.options.iconSize === undefined ? '' : ' btn-' + this.options.iconSize) +
+                ' dropdown-toggle" data-toggle="dropdown">',
                 '<span class="page-size">',
                 $allSelected ? this.options.formatAllRows() : this.options.pageSize,
                 '</span>',
@@ -1493,9 +1493,9 @@
                         sprintf(' type="%s"', type) +
                         sprintf(' value="%s"', item[that.options.idField]) +
                         sprintf(' checked="%s"', value === true ||
-                            (value && value.checked) ? 'checked' : undefined) +
+                        (value && value.checked) ? 'checked' : undefined) +
                         sprintf(' disabled="%s"', !column.checkboxEnabled ||
-                            (value && value.disabled) ? 'disabled' : undefined) +
+                        (value && value.disabled) ? 'disabled' : undefined) +
                         ' />',
                         that.options.cardView ? '</div>' : '</td>'
                     ].join('');
@@ -1814,19 +1814,19 @@
         fixedBody = this.$tableBody.get(0);
 
         scrollWidth = fixedBody.scrollWidth > fixedBody.clientWidth &&
-            fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ?
+        fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ?
             getScrollBarWidth() : 0;
 
         this.$el.css('margin-top', -this.$header.outerHeight());
 
         focused = $(':focus');
-        if(focused.length > 0) {
+        if (focused.length > 0) {
             var $th = focused.parents('th');
-            if($th.length > 0) {
+            if ($th.length > 0) {
                 var dataField = $th.attr('data-field');
-                if(dataField !== undefined) {
+                if (dataField !== undefined) {
                     var $headerTh = this.$header.find("[data-field='" + dataField + "']");
-                    if($headerTh.length > 0) {
+                    if ($headerTh.length > 0) {
                         $headerTh.find(":input").addClass("focus-temp");
                     }
                 }
@@ -1843,7 +1843,7 @@
 
 
         focusedTemp = $('.focus-temp:visible:eq(0)');
-        if(focusedTemp.length > 0) {
+        if (focusedTemp.length > 0) {
             focusedTemp.focus();
             this.$header.find('.focus-temp').removeClass('focus-temp');
         }
@@ -1943,8 +1943,8 @@
         scrollWidth = elWidth > this.$tableBody.width() ? getScrollBarWidth() : 0;
 
         this.$tableFooter.css({
-                'margin-right': scrollWidth
-            }).find('table').css('width', elWidth)
+            'margin-right': scrollWidth
+        }).find('table').css('width', elWidth)
             .attr('class', this.$el.attr('class'));
 
         $footerTd = this.$tableFooter.find('td');
@@ -2403,7 +2403,7 @@
     };
 
     BootstrapTable.prototype.getHiddenColumns = function () {
-        return $.grep(this.columns, function( column ) {
+        return $.grep(this.columns, function (column) {
             return !column.visible;
         });
     };