Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable/Disable on the fly #10

Open
peter-mghendi opened this issue Jan 15, 2020 · 0 comments
Open

Enable/Disable on the fly #10

peter-mghendi opened this issue Jan 15, 2020 · 0 comments

Comments

@peter-mghendi
Copy link

peter-mghendi commented Jan 15, 2020

@YanNerio I'm trying to enable/disable the rating bar on the fly. I have the following function, that should initialize the rating plugin as either enabled/disabled:

function initRatingWithState($, options, state){
    if ($.children().length) $.empty();
    const init = $.data('init');
    if (typeof init === 'number') options.initialRating = parseInt(init);
    options.disabled = state;
    $.emotionsRating(options);
}

It works perfectly when initializing the plugin the first time. All 'on-the-fly' changes do not work. Where am I going wrong?

EDIT: It doesn't work via the console, either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant