ソースを参照

Update source

zhixin 9 年 前
コミット
703562fccf
3 ファイル変更135 行追加108 行削除
  1. 118 96
      CHANGELOG.md
  2. 6 1
      DONATORS.md
  3. 11 11
      src/bootstrap-table.js

+ 118 - 96
CHANGELOG.md

@@ -1,4 +1,26 @@
-## ChangeLog
+ChangeLog
+---------
+
+### 1.10.2
+
+- fix(js): fix cardVisible doesn't work bug
+- feat(js): add support for transfer from rowspan / colspan table
+- fix(js): int field break toggleColumn
+- fix(locale): update it-IT locale
+- fix(locale): add formatAllRows in template locale
+- fix(js): table elements inside bootstrap table bug
+- docs(filter-control extension): add documentation for filterData
+- feat(js): add data variable to post-body event
+- feat(js): add `buttonsClass` option
+- fix(js): move formatter after cellStyle
+- feat(js): add `getVisibleColumns` method
+- feat(js): add resize event to fit the header
+- fix(js): the footer is hidden in card view
+- fix(filter-control extension): add check for null values on existsOptionInSelectControl
+- fix(js): fix sorting rows not working bug
+- refactor(filter-control extension): refactor the filterDataType method
+- feat(angular extension): add constant in order to get it from angular scope
+- fix(js): return field from visible cells
 
 ### 1.10.1
 
@@ -219,149 +241,149 @@
 
 ### 1.2.4
 
-* [enh] Fix #23: Add css and classes parameters to column cell.
-* [enh] Fix #64: Add support for change remote url.
-* [enh] Fix #112: update the `refresh` method.
-* [bug] Fix #113: Using radio type and cardView error.
-* [enh] Fix #117: Add `updateRow` method.
-* [enh] Fix #96, #103: apply `class` option to td elements.
-* [enh] Fix #97: add `sortable` class to header cells instead of `cursor: pointer`.
-* [enh] Fix #124: change `queryParams` and `queryParamsType` default option.
-* [enh] Remove the `eval` method.
-* [enh] Add `bootstrap-table-it-IT.js` locale.
+- [enh] Fix #23: Add css and classes parameters to column cell.
+- [enh] Fix #64: Add support for change remote url.
+- [enh] Fix #112: update the `refresh` method.
+- [bug] Fix #113: Using radio type and cardView error.
+- [enh] Fix #117: Add `updateRow` method.
+- [enh] Fix #96, #103: apply `class` option to td elements.
+- [enh] Fix #97: add `sortable` class to header cells instead of `cursor: pointer`.
+- [enh] Fix #124: change `queryParams` and `queryParamsType` default option.
+- [enh] Remove the `eval` method.
+- [enh] Add `bootstrap-table-it-IT.js` locale.
 
 ### 1.2.3
 
-* [bug] Fix the selected row class reset after toggle column bug.
-* [bug] Fix #86: invisible column are still searchable.
-* [bug] Fix search result error when toggle column display.
-* [enh] Add `clickToSelect` to columns.
-* [bug] Fix click-row event bug.
-* [enh] When field is undefined, use index instead.
-* [enh] Add `cache` option for AJAX calls.
-* [enh] Improve zh-TW translation.
-* [enh] #82: Add `getData` method.
-* [enh] #82: Add `remove` method.
+- [bug] Fix the selected row class reset after toggle column bug.
+- [bug] Fix #86: invisible column are still searchable.
+- [bug] Fix search result error when toggle column display.
+- [enh] Add `clickToSelect` to columns.
+- [bug] Fix click-row event bug.
+- [enh] When field is undefined, use index instead.
+- [enh] Add `cache` option for AJAX calls.
+- [enh] Improve zh-TW translation.
+- [enh] #82: Add `getData` method.
+- [enh] #82: Add `remove` method.
 
 ### 1.2.2
 
-* Fix #68: Add `showColumn`/`hideColumn` methods.
-* Fix #69: Add `bootstrap-table-es_AR.js` locale.
-* Fix #88: Add `bootstrap-table-fr_BE.js` locale.
-* Fix #85: Select row and add row class.
-* Add `halign` column option.
+- Fix #68: Add `showColumn`/`hideColumn` methods.
+- Fix #69: Add `bootstrap-table-es_AR.js` locale.
+- Fix #88: Add `bootstrap-table-fr_BE.js` locale.
+- Fix #85: Select row and add row class.
+- Add `halign` column option.
 
 ### 1.2.1
 
-* Fix #56: Pagination issue in bootstrap 2.3.
-* Fix #76: After refreshing table data, search no longer works.
-* Fix #77: After searching and then clearing the search field, table is no longer sortable.
-* Add `sortable` option, `false` to disable sortable of all columns.
-* Support localization for docs.
+- Fix #56: Pagination issue in bootstrap 2.3.
+- Fix #76: After refreshing table data, search no longer works.
+- Fix #77: After searching and then clearing the search field, table is no longer sortable.
+- Add `sortable` option, `false` to disable sortable of all columns.
+- Support localization for docs.
 
 ### 1.2.0
 
-* Fix bootstrap 2 table border bug.
-* Fix loading and not found record display bug.
-* Update ```minimunCountColumns``` option to ```minimumCountColumns```.
-* Fix sort order bug.
+- Fix bootstrap 2 table border bug.
+- Fix loading and not found record display bug.
+- Update `minimunCountColumns` option to `minimumCountColumns`.
+- Fix sort order bug.
 
 ### 1.1.5
 
-* Fix the bottom border bug on Chrome.
-* Add horizontal scroll for support.
-* Fix scroll header width error.
-* Add ```showRefresh``` and ```showToggle``` options.
+- Fix the bottom border bug on Chrome.
+- Add horizontal scroll for support.
+- Fix scroll header width error.
+- Add `showRefresh` and `showToggle` options.
 
 ### 1.1.4
 
-* Fix ```destroy``` method bug.
-* Initialize table data from HTML.
-* Fix the hidden table reset header bug.
+- Fix `destroy` method bug.
+- Initialize table data from HTML.
+- Fix the hidden table reset header bug.
 
 ### 1.1.3
 
-* Add ```events``` column option.
-* Add ```checkboxHeader``` option.
-* Add ```queryParamsType``` option.
-* Fix ie class bug, and fix duplicated data error.
+- Add `events` column option.
+- Add `checkboxHeader` option.
+- Add `queryParamsType` option.
+- Fix ie class bug, and fix duplicated data error.
 
 ### 1.1.2
 
-* Add switchable column option.
-* Add ```data-toggle``` attribute.
-* Add support for number search.
-* Use html function instead of text in header th.
+- Add switchable column option.
+- Add `data-toggle` attribute.
+- Add support for number search.
+- Use html function instead of text in header th.
 
 ### 1.1.1
 
-* Remove ```bootstrapVerion``` option.
-* Add ```data-page-list``` attribute.
-* Fix search data error.
-* Non case sensitive search in client side.
-* Added support for Danish translation.
+- Remove `bootstrapVerion` option.
+- Add `data-page-list` attribute.
+- Fix search data error.
+- Non case sensitive search in client side.
+- Added support for Danish translation.
 
 ### 1.1.0
 
-* Fix old firefox browser display error.
-* Add minimunCountColumns option.
-* Update the table body header implementation and resetView method.
-* Remove bootstrapVersion option.
-* Fix search data error.
+- Fix old firefox browser display error.
+- Add minimunCountColumns option.
+- Update the table body header implementation and resetView method.
+- Remove bootstrapVersion option.
+- Fix search data error.
 
 ### 1.0.6
 
-* Add jQuery events.
-* Add ```onDblClickRow``` event and ```onAll``` event.
-* Add ```singleSelect``` option.
-* Search improvent: add a timeout and trigger the search event when the text has changed to improve the search.
-* Scroll to top after data loaded.
-* Add ```toolbar``` option.
-* Add ```rowStyle``` option.
-* Add ```bootstrapVersion``` option.
+- Add jQuery events.
+- Add `onDblClickRow` event and `onAll` event.
+- Add `singleSelect` option.
+- Search improvent: add a timeout and trigger the search event when the text has changed to improve the search.
+- Scroll to top after data loaded.
+- Add `toolbar` option.
+- Add `rowStyle` option.
+- Add `bootstrapVersion` option.
 
 ### 1.0.5
 
-* Update the pagination list position.
-* Update ```queryParams``` option.
-* Add ```contentType``` and ```onBeforeLoad``` options.
-* Add server side pagination(```pageSize, pageNumber, searchText, sortName, sortOrder```).
-* Add ```COLUMN_DEFAULTS```.
-* Add ```refresh``` method.
-* Add ```index``` argument in ```formatter``` function.
-* Update card view display.
+- Update the pagination list position.
+- Update `queryParams` option.
+- Add `contentType` and `onBeforeLoad` options.
+- Add server side pagination(`pageSize, pageNumber, searchText, sortName, sortOrder`).
+- Add `COLUMN_DEFAULTS`.
+- Add `refresh` method.
+- Add `index` argument in `formatter` function.
+- Update card view display.
 
 ### 1.0.4
 
-* Add ```showLoading``` and ```hideLoading``` methods.
-* Add ```onLoadSuccess``` and ```onLoadError``` events.
-* Add ```clickToSelect``` option.
-* Add ```cardView``` option.
-* Add loading with ```formatLoadingMessage``` function.
-* Add ```idField``` option.
+- Add `showLoading` and `hideLoading` methods.
+- Add `onLoadSuccess` and `onLoadError` events.
+- Add `clickToSelect` option.
+- Add `cardView` option.
+- Add loading with `formatLoadingMessage` function.
+- Add `idField` option.
 
 ### 1.0.3
 
-* Update fixed headers.
-* Add zh-TW locale file.
-* Add ```showColumns``` option and ```visible``` column option.
-* Update ```hideHeader``` option to ```showHeader```.
-* Add ```formatNoMatches``` locale function.
-* Add table events.
+- Update fixed headers.
+- Add zh-TW locale file.
+- Add `showColumns` option and `visible` column option.
+- Update `hideHeader` option to `showHeader`.
+- Add `formatNoMatches` locale function.
+- Add table events.
 
 ### 1.0.2
 
-* Add i18n support.
-* Add ```selectItemName``` option.
-* Update the ```pageList``` default.
-* Add ```search``` option.
-* Add ```destroy``` method.
-* Add page list support.
+- Add i18n support.
+- Add `selectItemName` option.
+- Update the `pageList` default.
+- Add `search` option.
+- Add `destroy` method.
+- Add page list support.
 
 ### 1.0.1
 
-* Add ```pagination``` support.
+- Add `pagination` support.
 
 ### 1.0.0
 
-* Initial release
+- Initial release

+ 6 - 1
DONATORS.md

@@ -21,7 +21,9 @@
 * 우공이산 우공이산 - $50
 * Empirica srl - $15
 * Hassan Gareballa - $10
-* Jihwang Yi - $10
+* 지황 이 - $10
+* Onur Kose - $15
+* Александр Вейсов - $30
 
 ## 支付宝
 
@@ -39,3 +41,6 @@
 
 * 笑:50元
 * 一牛九毛:100元
+* 111111:4元
+* 佚名:6.6元
+* Evo4me:30元

+ 11 - 11
src/bootstrap-table.js

@@ -4,7 +4,7 @@
  * https://github.com/wenzhixin/bootstrap-table/
  */
 
-!function ($) {
+(function ($) {
     'use strict';
 
     // TOOLS DEFINITION
@@ -475,7 +475,7 @@
 
     BootstrapTable.LOCALES = [];
 
-    BootstrapTable.LOCALES['en-US'] = BootstrapTable.LOCALES['en'] = {
+    BootstrapTable.LOCALES['en-US'] = BootstrapTable.LOCALES.en = {
         formatLoadingMessage: function () {
             return 'Loading, please wait...';
         },
@@ -589,7 +589,7 @@
         if (this.options.locale) {
             var parts = this.options.locale.split(/-|_/);
             parts[0].toLowerCase();
-            parts[1] && parts[1].toUpperCase();
+            if (parts[1]) parts[1].toUpperCase();
             if ($.fn.bootstrapTable.locales[this.options.locale]) {
                 // locale as requested
                 $.extend(this.options, $.fn.bootstrapTable.locales[this.options.locale]);
@@ -661,7 +661,7 @@
             $(this).find('th').each(function () {
                 // Fix #2014 - getFieldIndex and elsewhere assume this is string, causes issues if not
                 if (typeof $(this).data('field') !== 'undefined') {
-                    $(this).data('field', new String($(this).data('field')).valueOf()); 
+                    $(this).data('field', $(this).data('field') + '');
                 }
                 column.push($.extend({}, {
                     title: $(this).html(),
@@ -760,7 +760,7 @@
         $.each(this.options.columns, function (i, columns) {
             html.push('<tr>');
 
-            if (i == 0 && !that.options.cardView && that.options.detailView) {
+            if (i === 0 && !that.options.cardView && that.options.detailView) {
                 html.push(sprintf('<th class="detail" rowspan="%s"><div class="fht-cell"></div></th>',
                     that.options.columns.length));
             }
@@ -1290,7 +1290,8 @@
             $first, $pre,
             $next, $last,
             $number,
-            data = this.getData();
+            data = this.getData(),
+            pageList = this.options.pageList;
 
         if (this.options.sidePagination !== 'server') {
             this.options.totalRows = data.length;
@@ -1350,8 +1351,7 @@
                     ' <span class="caret"></span>',
                     '</button>',
                     '<ul class="dropdown-menu" role="menu">'
-                ],
-                pageList = this.options.pageList;
+                ];
 
             if (typeof this.options.pageList === 'string') {
                 var list = this.options.pageList.replace('[', '').replace(']', '')
@@ -1536,7 +1536,7 @@
     };
 
     BootstrapTable.prototype.onPagePre = function (event) {
-        if ((this.options.pageNumber - 1) == 0) {
+        if ((this.options.pageNumber - 1) === 0) {
             this.options.pageNumber = this.options.totalPages;
         } else {
             this.options.pageNumber--;
@@ -1939,7 +1939,7 @@
         }
 
         if (!($.isEmptyObject(this.filterColumnsPartial))) {
-            params['filter'] = JSON.stringify(this.filterColumnsPartial, null);
+            params.filter = JSON.stringify(this.filterColumnsPartial, null);
         }
 
         data = calculateObjectValue(this.options, this.options.queryParams, [params], data);
@@ -2994,4 +2994,4 @@
     $(function () {
         $('[data-toggle="table"]').bootstrapTable();
     });
-}(jQuery);
+})(jQuery);