Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A7E79114BE for ; Thu, 19 Jun 2014 12:55:40 +0000 (UTC) Received: (qmail 60997 invoked by uid 500); 19 Jun 2014 12:55:40 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 60967 invoked by uid 500); 19 Jun 2014 12:55:40 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 60958 invoked by uid 99); 19 Jun 2014 12:55:40 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jun 2014 12:55:40 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 05982983D8C; Thu, 19 Jun 2014 12:55:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ababiichuk@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: AMBARI-6204 Paging does not work on Hosts page. (Max Shepel via ababiichuk) Date: Thu, 19 Jun 2014 12:55:39 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk 345354072 -> 2ce73d7c0 AMBARI-6204 Paging does not work on Hosts page. (Max Shepel via ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2ce73d7c Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2ce73d7c Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2ce73d7c Branch: refs/heads/trunk Commit: 2ce73d7c09d9fd6b4840ce330b87051ec9ebd57a Parents: 3453540 Author: aBabiichuk Authored: Thu Jun 19 15:48:45 2014 +0300 Committer: aBabiichuk Committed: Thu Jun 19 15:48:45 2014 +0300 ---------------------------------------------------------------------- ambari-web/app/views/main/host.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/2ce73d7c/ambari-web/app/views/main/host.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js index 30103c9..8af2d8f 100644 --- a/ambari-web/app/views/main/host.js +++ b/ambari-web/app/views/main/host.js @@ -67,7 +67,11 @@ App.MainHostView = App.TableView.extend(App.TableServerProvider, { * @type {Array} */ pageContent: function () { - return this.get('filteredContent').slice(this.get('startIndex') - 1, this.get('endIndex')).sort(function (a, b) { + var content = this.get('filteredContent'); + if (content.length > this.get('endIndex') - this.get('startIndex') + 1) { + content = content.slice(this.get('startIndex') - 1, this.get('endIndex')); + } + return content.sort(function (a, b) { return a.get('index') - b.get('index'); }); }.property('filteredCount', 'startIndex', 'endIndex'),