[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant-frontends] branch master updated: Better sc
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant-frontends] branch master updated: Better scrolling mgmt. |
Date: |
Fri, 24 Mar 2017 13:05:38 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant-frontends.
The following commit(s) were added to refs/heads/master by this push:
new 30d5bb3 Better scrolling mgmt.
30d5bb3 is described below
commit 30d5bb3c7f59e737bd3a67bb9854d4be621fbbda
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri Mar 24 13:05:28 2017 +0100
Better scrolling mgmt.
---
talerfrontends/blog/static/backoffice.css | 4 ++++
talerfrontends/blog/static/backoffice.js | 18 ++++++++++++++----
talerfrontends/blog/static/web-common | 2 +-
talerfrontends/blog/templates/backoffice.html | 24 ++++++++++++++----------
talerfrontends/donations/static/web-common | 2 +-
5 files changed, 34 insertions(+), 16 deletions(-)
diff --git a/talerfrontends/blog/static/backoffice.css
b/talerfrontends/blog/static/backoffice.css
index 5cb7609..63a684c 100644
--- a/talerfrontends/blog/static/backoffice.css
+++ b/talerfrontends/blog/static/backoffice.css
@@ -11,6 +11,10 @@
z-index: 2;
}
+#history-container {
+ margin-bottom: 10cm;
+}
+
.date, .amount {
text-align: right;
}
diff --git a/talerfrontends/blog/static/backoffice.js
b/talerfrontends/blog/static/backoffice.js
index 1041221..5c1c478 100644
--- a/talerfrontends/blog/static/backoffice.js
+++ b/talerfrontends/blog/static/backoffice.js
@@ -28,7 +28,9 @@
var FRACTION = 100000000;
var TIMESTAMP = 0;
var START = 0;
+var DELTA = 5
var INSTANCE = "FSF";
+var LAST = 0;
function amount_to_string(amount){
var number = Number(amount.value) + (Number(amount.fraction)/FRACTION);
@@ -232,10 +234,13 @@ function fill_table(history, execution_time){
function get_history(scroll){
var loader = document.getElementsByClassName("loader")[0];
loader.style.visibility = "visible";
- if(scroll)
- START += 20;
+ var qs = `/history?&instance=${INSTANCE}&delta=${DELTA}`;
+ if(scroll){
+ START = LAST;
+ qs += `&start=${START}`;
+ }
var req = new XMLHttpRequest();
- req.open("GET",
`/history?timestamp=${TIMESTAMP}&instance=${INSTANCE}&start=${START}`, true);
+ req.open("GET", qs, true);
req.onload = function(){
if(4 == req.readyState){
if(200 == req.status){
@@ -244,6 +249,8 @@ function get_history(scroll){
console.log("Got invalid JSON");
return;
}
+ if(0 < history.length)
+ LAST = history[history.length - 1].row_id;
fill_table(history);
}
else{
@@ -255,4 +262,7 @@ function get_history(scroll){
}
document.addEventListener("DOMContentLoaded", () => get_history(false));
-document.addEventListener("scroll", () => get_history(true));
+document.addEventListener("scroll", function(){
+ if(window.innerHeight + window.scrollY >= document.body.offsetHeight)
+ window.setTimeout(()=>get_history(true), 400);
+ });
diff --git a/talerfrontends/blog/static/web-common
b/talerfrontends/blog/static/web-common
index 6dd8ca1..d7e0135 160000
--- a/talerfrontends/blog/static/web-common
+++ b/talerfrontends/blog/static/web-common
@@ -1 +1 @@
-Subproject commit 6dd8ca1675817cc0ca65f0819489234eeafaa2ed
+Subproject commit d7e013594d15388b1a7342a44a0e9c8d4ecca82d
diff --git a/talerfrontends/blog/templates/backoffice.html
b/talerfrontends/blog/templates/backoffice.html
index 0fd2532..74e9494 100644
--- a/talerfrontends/blog/templates/backoffice.html
+++ b/talerfrontends/blog/templates/backoffice.html
@@ -4,16 +4,20 @@
<p>This page simulates a backoffice facility. Through it,
the user can see the money flow from Taler transactions to
wire transfers and viceversa.</p>
- <table id="history" width="60%" style="visibility: hidden;">
- <tbody>
- <tr>
- <th class="order-id">Order ID</th>
- <th class="amount">Amount</th>
- <th class="date">Date</th>
- </tr>
- </tbody>
- </table>
- <div class="loader"></div>
+ <div id="history-container">
+ <table id="history" width="60%" style="visibility: hidden;">
+ <tbody>
+ <tr>
+ <th class="order-id">Order ID</th>
+ <th class="amount">Amount</th>
+ <th class="date">Date</th>
+ </tr>
+ </tbody>
+ </table>
+ <br/>
+ <div class="loader"></div>
+ </div>
+
<div id="popup1" class="overlay">
<div class="popup">
<h2>
diff --git a/talerfrontends/donations/static/web-common
b/talerfrontends/donations/static/web-common
index 6dd8ca1..d7e0135 160000
--- a/talerfrontends/donations/static/web-common
+++ b/talerfrontends/donations/static/web-common
@@ -1 +1 @@
-Subproject commit 6dd8ca1675817cc0ca65f0819489234eeafaa2ed
+Subproject commit d7e013594d15388b1a7342a44a0e9c8d4ecca82d
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant-frontends] branch master updated: Better scrolling mgmt.,
gnunet <=