Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A411B200B7A for ; Mon, 5 Sep 2016 16:56:32 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A28BC160ABC; Mon, 5 Sep 2016 14:56:32 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EA5FB160AB0 for ; Mon, 5 Sep 2016 16:56:31 +0200 (CEST) Received: (qmail 18962 invoked by uid 500); 5 Sep 2016 14:56:31 -0000 Mailing-List: contact commits-help@ponymail.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ponymail.incubator.apache.org Delivered-To: mailing list commits@ponymail.incubator.apache.org Received: (qmail 18953 invoked by uid 99); 5 Sep 2016 14:56:31 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Sep 2016 14:56:31 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 97C19C639A for ; Mon, 5 Sep 2016 14:56:30 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.739 X-Spam-Level: X-Spam-Status: No, score=-3.739 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.519] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id j0l5M72tafx8 for ; Mon, 5 Sep 2016 14:56:30 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 091515F29A for ; Mon, 5 Sep 2016 14:56:28 +0000 (UTC) Received: (qmail 18937 invoked by uid 99); 5 Sep 2016 14:56:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Sep 2016 14:56:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0936CE0551; Mon, 5 Sep 2016 14:56:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: humbedooh@apache.org To: commits@ponymail.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-ponymail git commit: auto-compute how many results per page based on window height Date: Mon, 5 Sep 2016 14:56:27 +0000 (UTC) archived-at: Mon, 05 Sep 2016 14:56:32 -0000 Repository: incubator-ponymail Updated Branches: refs/heads/coffee-and-cake 30a6a077e -> de3d4ca8b auto-compute how many results per page based on window height Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/de3d4ca8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/de3d4ca8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/de3d4ca8 Branch: refs/heads/coffee-and-cake Commit: de3d4ca8bec4c5bb16c4cded0814b764c00ad2e3 Parents: 30a6a07 Author: Daniel Gruno Authored: Mon Sep 5 16:56:14 2016 +0200 Committer: Daniel Gruno Committed: Mon Sep 5 16:56:14 2016 +0200 ---------------------------------------------------------------------- site/js/coffee/listview_basic.coffee | 7 ++++++- site/js/ponymail-coffee.js | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/de3d4ca8/site/js/coffee/listview_basic.coffee ---------------------------------------------------------------------- diff --git a/site/js/coffee/listview_basic.coffee b/site/js/coffee/listview_basic.coffee index d1f075e..cb48b68 100644 --- a/site/js/coffee/listview_basic.coffee +++ b/site/js/coffee/listview_basic.coffee @@ -20,8 +20,13 @@ ### class BasicListView ### json: from stats.lua, rpp = results per page, pos = starting position (from 0) ### - constructor: (@json, @rpp = 15, @pos = 0) -> + constructor: (@json, @rpp = 0, @pos = 0) -> + ### @rpp == 0 == auto-compute num of items ### + if @rpp == 0 + @rpp= Math.max( parseInt((window.innerHeight - 300) / 40), 5) + @rpp = @rpp - (@rpp % 5) + ### Set the header first ### hd = get('header') if @json.list http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/de3d4ca8/site/js/ponymail-coffee.js ---------------------------------------------------------------------- diff --git a/site/js/ponymail-coffee.js b/site/js/ponymail-coffee.js index 040a94b..ac26cb0 100644 --- a/site/js/ponymail-coffee.js +++ b/site/js/ponymail-coffee.js @@ -1318,9 +1318,15 @@ BasicListView = (function() { function BasicListView(json1, rpp1, pos1) { var date, hd, m, ref, y; this.json = json1; - this.rpp = rpp1 != null ? rpp1 : 15; + this.rpp = rpp1 != null ? rpp1 : 0; this.pos = pos1 != null ? pos1 : 0; + /* @rpp == 0 == auto-compute num of items */ + if (this.rpp === 0) { + this.rpp = Math.max(parseInt((window.innerHeight - 300) / 40), 5); + this.rpp = this.rpp - (this.rpp % 5); + } + /* Set the header first */ hd = get('header'); if (this.json.list) {