瀏覽代碼

AMBARI-6268. step 6 pagination is slow (alexantonenko)

Alex Antonenko 11 年之前
父節點
當前提交
a6b1217e42
共有 2 個文件被更改,包括 7 次插入33 次删除
  1. 1 3
      ambari-web/app/templates/wizard/step6.hbs
  2. 6 30
      ambari-web/app/views/wizard/step6_view.js

+ 1 - 3
ambari-web/app/templates/wizard/step6.hbs

@@ -52,9 +52,7 @@
               {{#each checkbox in host.checkboxes}}
                 <td>
                   <label class="checkbox">
-                    {{#view view.checkboxView checkboxBinding="checkbox"}}
-                      {{checkbox.title}}
-                    {{/view}}
+                      <input {{bindAttr checked = "checkbox.checked" disabled="checkbox.isInstalled"}} {{action "checkboxClick" checkbox target="view" }} type="checkbox"/>{{checkbox.title}}
                   </label>
                 </td>
               {{/each}}

+ 6 - 30
ambari-web/app/views/wizard/step6_view.js

@@ -91,35 +91,11 @@ App.WizardStep6View = App.TableView.extend({
     this.set('label', label);
   },
 
-  /**
-   * Binding host property with dynamic name
-   * @type {Ember.Checkbox}
-   */
-  checkboxView: Em.Checkbox.extend({
-
-    /**
-     * Header object with host property name
-     * @type {object}
-     */
-    checkbox: null,
-
-    //if setAll true there is no need to check every checkbox whether all checked or not
-
-    checkedBinding: 'checkbox.checked',
-
-    disabledBinding: 'checkbox.isInstalled',
-
-    /**
-     * Click-handler on checkbox
-     * @method click
-     */
-    click: function () {
-      if ($.browser.mozilla) {
-        this.toggleProperty('checkbox.checked');
-      }
-      this.get('controller').checkCallback(this.get('checkbox.component'));
-    }
-  })
+  checkboxClick: function(e) {
+    var checkbox = e.context;
+    checkbox.toggleProperty('checked');
+    this.get('controller').checkCallback(checkbox.component);
+  }
 });
 
 App.WizardStep6HostView = Em.View.extend({
@@ -153,4 +129,4 @@ App.WizardStep6HostView = Em.View.extend({
       });
     }
   }
-});
+});