Add delay customization to tooltip.js

This MR allows the delay of tooltips instantiated using
tooltip.js to be customized through localStorage.
This commit is contained in:
Nathan Friend 2019-07-09 13:25:00 -03:00
parent ebcf92c585
commit 9c55031ff7
No known key found for this signature in database
GPG key ID: E010A0869C9F35D9

View file

@ -3,8 +3,12 @@ import '~/commons/bootstrap';
export default { export default {
bind(el) { bind(el) {
const glTooltipDelay = localStorage.getItem('gl-tooltip-delay');
const delay = glTooltipDelay ? JSON.parse(glTooltipDelay) : 0;
$(el).tooltip({ $(el).tooltip({
trigger: 'hover', trigger: 'hover',
delay,
}); });
}, },