Move loadanimnum (article threshold to show load anim) into settings.

This commit is contained in:
kor 2018-11-07 14:49:36 +13:00
parent ab517aa247
commit 02dc3594f3
3 changed files with 7 additions and 5 deletions

View File

@ -68,11 +68,12 @@ Stored in a human-readable, flat-file database called [Indental](https://wiki.xx
| ---: | :--- | | ---: | :--- |
| STATSNUMTAGS | max limit of tags to show in menu | | STATSNUMTAGS | max limit of tags to show in menu |
| STATSNUMTYPE | max limit of types to show in menu | | STATSNUMTYPE | max limit of types to show in menu |
| WIDEARTICLE | allow wide entries (`WIDE : true`) | | LOADANIMNUM | threshold number of articles in query/displayed to trigger loading animation to display |
| AUTOWIDETRIGGER | automaticly wide entry if it has more QOTE entries than this number | | WIDEARTICLE | allow wide entries (`WIDE : true`) |
| AUTOWIDETRIGGER | automatically wide entry if it has more QOTE entries than this number |
| USEMASONRY | enable [masonry](https://masonry.desandro.com/) layout library usage | | USEMASONRY | enable [masonry](https://masonry.desandro.com/) layout library usage |
| MASONRYPROGRESS | masonry re-layout as images load (true), or only once all images complete (false) | | MASONRYPROGRESS | masonry re-layout as images load (true), or only once all images complete (false) |
| ARTICLEIDBASE | CSS name prefix | | ARTICLEIDBASE | CSS name prefix |
| SHOWUPPER | toggle display of upper entry element(s) | | SHOWUPPER | toggle display of upper entry element(s) |
| SHOWTITLE | toggle display of entry title | | SHOWTITLE | toggle display of entry title |
| SHOWAUTH | toggle display of entry author(s) | | SHOWAUTH | toggle display of entry author(s) |

View File

@ -2,6 +2,7 @@ const SETTINGS =
{ {
STATSNUMTAGS: 5, STATSNUMTAGS: 5,
STATSNUMTYPE: 10, STATSNUMTYPE: 10,
LOADANIMNUM: 50,
WIDEARTICLE: true, WIDEARTICLE: true,
AUTOWIDETRIGGER: 4, AUTOWIDETRIGGER: 4,
USEMASONRY: true, USEMASONRY: true,

View File

@ -3,7 +3,6 @@ function Main()
this.util = null; this.util = null;
this.wrap = null; this.wrap = null;
this.articles = null; this.articles = null;
this.articlesDisplayed = 0;
this.grid = null; this.grid = null;
this.nav = null; this.nav = null;
this.add = null; this.add = null;
@ -12,6 +11,7 @@ function Main()
this.queryCur = ''; this.queryCur = '';
this.queryPrev = ''; this.queryPrev = '';
this.queryPrevAdd = ''; this.queryPrevAdd = '';
this.articlesDisplayed = 0;
var parent = this; var parent = this;
this.install = function() this.install = function()
@ -81,7 +81,7 @@ function Main()
seer.note('filter db'); seer.note('filter db');
let delay = 0; let delay = 0;
if (filteredLength > 50 || this.articlesDisplayed > 50) if (filteredLength > SETTINGS.LOADANIMNUM || this.articlesDisplayed > SETTINGS.LOADANIMNUM)
{ {
// adding or removing a large number of articles can take time, so show loader // adding or removing a large number of articles can take time, so show loader
this.grid.clear(); this.grid.clear();