You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/06/19 01:56:21 UTC

svn commit: r1494393 - /incubator/ambari/trunk/ambari-web/app/views/main/apps_view.js

Author: yusaku
Date: Tue Jun 18 23:56:21 2013
New Revision: 1494393

URL: http://svn.apache.org/r1494393
Log:
AMBARI-2418. Incorrect behavior of jobs paging. (Oleg Nechiporenko via yusaku)

Modified:
    incubator/ambari/trunk/ambari-web/app/views/main/apps_view.js

Modified: incubator/ambari/trunk/ambari-web/app/views/main/apps_view.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/apps_view.js?rev=1494393&r1=1494392&r2=1494393&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/apps_view.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/apps_view.js Tue Jun 18 23:56:21 2013
@@ -38,7 +38,7 @@ App.MainAppsView = Em.View.extend({
       }
     }.observes("controller.paginationObject"),
     click: function (event) {
-      if (this.class == "paginate_previous") {
+      if (this.get('class') == "paginate_previous") {
         var startIndex = parseInt(this.get("controller.paginationObject.startIndex")) - 1;
         var showRows = parseInt(this.get("controller.filterObject.iDisplayLength"));
         var startDisplayValue = Math.max(0, startIndex - showRows);
@@ -52,14 +52,14 @@ App.MainAppsView = Em.View.extend({
     classNameBindings: ['class'],
     class: "",
     calculateClass: function () {
-      if ((parseInt(this.get("controller.paginationObject.endIndex")) + 1) < parseInt(this.get("controller.paginationObject.iTotalDisplayRecords"))) {
+      if ((parseInt(this.get("controller.paginationObject.endIndex"))) < parseInt(this.get("controller.paginationObject.iTotalDisplayRecords"))) {
         this.set("class", "paginate_next");
       } else {
         this.set("class", "paginate_disabled_next");
       }
     }.observes("controller.paginationObject"),
     click: function (event) {
-      if (this.class == "paginate_next") {
+      if (this.get('class') == "paginate_next") {
         var startDisplayValue = parseInt(this.get("controller.paginationObject.endIndex"));
         this.set("controller.filterObject.iDisplayStart", startDisplayValue);
       }
@@ -75,7 +75,6 @@ App.MainAppsView = Em.View.extend({
    If no runs to display set emptyData to true and reset Avg table data, else to set emptyData to false.
    */
   emptyDataObserver:function(){
-    //debugger;
     if(this.get("controller.paginationObject.iTotalRecords") != null && this.get("controller.paginationObject.iTotalDisplayRecords")>0){
       this.set("emptyData",false);
     }else{
@@ -106,23 +105,23 @@ App.MainAppsView = Em.View.extend({
     defaultColumn: 8,
 
     didInsertElement: function () {
-      this.set("widthClass", "col" + this.content.index);
-      if (this.content.index == this.defaultColumn) {
+      this.set("widthClass", "col" + this.get('content.index'));
+      if (this.get('content.index') == this.get('defaultColumn')) {
         this.setControllerObj(this.content.index, "DESC");
         this.set("class", "sorting_desc");
       }
     },
     click: function (event) {
-      console.log(this.class);
-      if (this.class == "sorting") {
+      console.log(this.get('class'));
+      if (this.get('class') == "sorting") {
         this.resetSortClass();
-        this.setControllerObj(this.content.index, "ASC");
+        this.setControllerObj(this.get('content.index'), "ASC");
         this.set("class", "sorting_asc");
-      } else if (this.class == "sorting_asc") {
-        this.setControllerObj(this.content.index, "DESC");
+      } else if (this.get('class') == "sorting_asc") {
+        this.setControllerObj(this.get('content.index'), "DESC");
         this.set("class", "sorting_desc");
-      } else if (this.class == "sorting_desc") {
-        this.setControllerObj(this.content.index, "ASC");
+      } else if (this.get('class') == "sorting_desc") {
+        this.setControllerObj(this.get('content.index'), "ASC");
         this.set("class", "sorting_asc");
       }
     },