arvgta / ajaxify

Ajaxify - An Ajax Plugin
https://4nf.org/
275 stars 123 forks source link

Possible bug in alwayshints in plain vanilla version #214

Closed arvgta closed 3 years ago

arvgta commented 3 years ago

EDIT: There is no known error in alwayshints handling nor a timing problems after all... However, alwayshints has to be setup properly!


On two occasions:

and

...a possible bug in alwayshints in the plain vanilla version of Ajaxify has been reported.

Does anyone have a similar problem?


Salient code:

Hints JSON declaration:

$.h = {};

General hints handling:

class Hints { constructor(h) { let _ = this;
    _.list = (typeof h === 'string' && h.length > 0) ? h.split(", ") : false; //hints are passed as a comma separated string 
    _.find = (t) => (!t || !_.list) ? false : _.list.some(h => t.iO(h)); //iterate through hints within passed text (t)
}}

alwayshints handling in class addAll:

class AddAll { constructor() {
    let $scriptsO = [], $sCssO = [], $sO = [], PK = 0, url = 0;
    $.h.alwayshints = new Hints($.s.alwayshints);

and

_classAlways = $t => $t.getAttribute("data-class") == "always" || $.h.alwayshints.find(url),
arvgta commented 3 years ago

Most probably not a bug in Ajaxify - thus closing