This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
The following commit(s) were added to refs/heads/master by this push:
new f707f15 More global constants
f707f15 is described below
commit f707f15c004946e3435c53229a376248b4a26b4b
Author: Sebb <[email protected]>
AuthorDate: Thu Nov 18 19:51:08 2021 +0000
More global constants
---
webui/js/source/aavariables.js | 3 +++
webui/js/source/sidebar-calendar.js | 7 +++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/webui/js/source/aavariables.js b/webui/js/source/aavariables.js
index 25c1e40..29b6d52 100644
--- a/webui/js/source/aavariables.js
+++ b/webui/js/source/aavariables.js
@@ -50,6 +50,9 @@ let G_full_emails = {};
let G_current_index_pos = 0;
let G_current_per_page = 0;
+// sidebar calendar
+const MONTHS_SHORTENED = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul',
'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
+const CALENDAR_YEARS_SHOWN = 4; // TODO: should this be configurable?
const PONYMAIL_DATE_FORMAT = {
weekday: 'long',
diff --git a/webui/js/source/sidebar-calendar.js
b/webui/js/source/sidebar-calendar.js
index b5e6ae3..8a9ea2d 100644
--- a/webui/js/source/sidebar-calendar.js
+++ b/webui/js/source/sidebar-calendar.js
@@ -15,9 +15,7 @@
limitations under the License.
*/
-const MONTHS_SHORTENED = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul',
'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
let calendar_index = 0;
-let calendar_years_shown = 4;
function renderCalendar(FY, FM, LY, LM, activity = null) {
calendar_index = 0;
@@ -121,8 +119,8 @@ function renderCalendar(FY, FM, LY, LM, activity = null) {
cdiv.inject(chevron);
// If we have > 4 years, hide the rest
- if (N > calendar_years_shown) {
- for (let i = calendar_years_shown; i < N; i++) {
+ if (N > CALENDAR_YEARS_SHOWN) {
+ for (let i = CALENDAR_YEARS_SHOWN; i < N; i++) {
let obj = document.getElementById('sidebar_calendar_' + i);
if (obj) {
obj.style.display = "none";
@@ -133,6 +131,7 @@ function renderCalendar(FY, FM, LY, LM, activity = null) {
}
function calendar_scroll(me, x) {
+ console.log(me)
let years = document.getElementsByClassName('sidebar_calendar_year');
calendar_index = Math.max(Math.min(years.length - x, calendar_index + x),
0);
if (calendar_index > 0) {