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

Cancel show in the onBeforeShow event #346

Closed
dioslaska opened this Issue Aug 18, 2015 · 2 comments

Comments

Projects
None yet
1 participant
@dioslaska
Copy link
Contributor

dioslaska commented Aug 18, 2015

Be able to cancel the showing of the popup in the onBeforeShow event by returning false (similar to onClose).
E.g:

$('#mydate').mobiscroll().date({
     onBeforeShow: function () {
          if (someCondition) {
              return false; // This should prevent show
          }
     }
});

@dioslaska dioslaska added this to the 2.17.0 milestone Aug 18, 2015

@dioslaska

This comment has been minimized.

Copy link
Contributor

dioslaska commented Aug 19, 2015

Current workaround is to attach the tap event manually and check the condition there:

$('#mydate').prop('readonly', true).mobiscroll().date({
    showOnTap: false,
    onInit: function (inst) {
        inst.tap($(this), function () {
            if (someCondition) {
                $(this).mobiscroll('show');
            }
        });
    }
});
@dioslaska

This comment has been minimized.

Copy link
Contributor

dioslaska commented Aug 24, 2015

Done, will be released in 2.17.0

@dioslaska dioslaska closed this Aug 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment