Hi
How can I remove a "barba pjax listener" from a link ?
for example in Wordpress i would like to remove the listener from the wp admin bar links, i can not set the barba ignore class to those links so i think the best option is to remove the click listener on those anchors.
In your case you may just disable Barba.js Pjax is the user is logged as administrator:
if (window.ADMIN_BAR_VISIBLE) {
Barba.Pjax.preventCheck = function() {
return false;
};
}
Of course you need to pass window.ADMIN_BAR_VISIBLE from wordpress;
i don't want to disable the pjax :)
Then, if you want to ignore some links you can add the class .no-barba on the a tag.
Otherwise, you can replace the Barba.Pjax.preventCheck, adding your own logic control.
https://github.com/luruke/barba.js/blob/master/src/Pjax/Pjax.js#L207
Nice, thank you !
Most helpful comment
Then, if you want to ignore some links you can add the class
.no-barbaon theatag.Otherwise, you can replace the
Barba.Pjax.preventCheck, adding your own logic control.https://github.com/luruke/barba.js/blob/master/src/Pjax/Pjax.js#L207