xbsoftware / enjoyhint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom button label

BrownSim opened this issue · comments

commented

Hello

This "skipButton" : {className: "mySkip", text: "SKIP"}, does not work anymore

This code https://github.com/xbsoftware/enjoyhint/blob/master/src/enjoyhint.js#L209
is executed before this one :
https://github.com/xbsoftware/enjoyhint/blob/master/src/jquery.enjoyhint.js#L994

It's not working for me too, did you find any alternative solution?

An other solution could be to manually replace the text, it's a bit trash but kinda works.

var enjoyhint_instance = new EnjoyHint({});

var enjoyhint_script_steps = [
{
           'next #button' : 'bla bla'
}
];

enjoyhint_instance.set(enjoyhint_script_steps);

enjoyhint_instance.run();

setTimeout(() => {
          $('.enjoyhint_next_btn').text("NEXT");
          $('.enjoyhint_prev_btn').text("PREV");
          $('.enjoyhint_skip_btn').text("SKIP");
}, 400);

$(document).on('click', '.enjoyhint_next_btn', function(){
           setTimeout(() => {
                    $('.enjoyhint_next_btn').text("NEXT");
                    $('.enjoyhint_prev_btn').text("PREV");
                    $('.enjoyhint_skip_btn').text("SKIP");
           }, 400);
});

$(document).on('click', '.enjoyhint_prev_btn', function(){
           setTimeout(() => {
                   $('.enjoyhint_next_btn').text("NEXT");
                   $('.enjoyhint_prev_btn').text("PREV");
                   $('.enjoyhint_skip_btn').text("SKIP");
           }, 400);
});