ソースを参照

Merge pull request #426 from djhvscf/master

Code consistency
文翼 11 年 前
コミット
c3d14e930c
1 ファイル変更9 行追加7 行削除
  1. 9 7
      src/bootstrap-table.js

+ 9 - 7
src/bootstrap-table.js

@@ -66,7 +66,7 @@
         outer.css('overflow', 'scroll');
         w2 = inner[0].offsetWidth;
 
-        if (w1 == w2) {
+        if (w1 === w2) {
             w2 = outer[0].clientWidth;
         }
 
@@ -98,7 +98,7 @@
     };
 
     var escapeHTML = function (text) {
-        if (typeof text == 'string') {
+        if (typeof text === 'string') {
             return text
                 .replace(/&/g, "&")
                 .replace(/</g, "&lt;")
@@ -514,7 +514,7 @@
                 if (aa === bb) {
                     return 0;
                 }
-                if (aa.localeCompare(bb) == -1) {
+                if (aa.localeCompare(bb) === -1) {
                     return order * -1;
                 }
                     
@@ -673,7 +673,9 @@
         var text = $.trim($(event.currentTarget).val());
 
         // trim search input
-        if(this.options.trimOnSearch) $(event.currentTarget).val(text);
+        if(this.options.trimOnSearch) {
+			$(event.currentTarget).val(text);
+		}
 
         if (text === this.searchText) {
             return;
@@ -727,11 +729,11 @@
     };
 
     BootstrapTable.prototype.initPagination = function () {
-        this.$pagination = this.$container.find('.fixed-table-pagination');
-
-        if (!this.options.pagination) {
+		if (!this.options.pagination) {
             return;
         }
+		this.$pagination = this.$container.find('.fixed-table-pagination');
+
         var that = this,
             html = [],
             i, from, to,