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

duplication problem #290

Closed
instagramlover opened this issue Jul 8, 2017 · 5 comments
Closed

duplication problem #290

instagramlover opened this issue Jul 8, 2017 · 5 comments

Comments

@instagramlover
Copy link

I am using this selector ( onmousedown ontouchend ) , some time the pop up show twice on mobile and some time on pc
using jquery-confirm v3.2.0

I want to update to jquery-confirm v3.2.3 but i am not sure if that will break anything , so i want to be sure
1- how prevent duplication of the pop up
2- is it a bug
3- can i upgrade safely

Regards

@craftpip
Copy link
Owner

craftpip commented Jul 9, 2017

Please post your code for clear understanding,

@snap608
Copy link

snap608 commented Jul 25, 2017

I had kind of the same problem. :) I solved it in a bit hacky way:

$(".confirm-delete:not(.haveConfirmAttached)").confirm({
      ...
}).addClass("haveConfirmAttached");

I load content into a table via Ajax (jQuery Datatables) due to paging and need to add a confirmation dialog to the [Delete] button for each row. The problem I had was that confim() did attach multiple click events (and triggered multiple confirm dialog when hitting a button). This is due to elements in the table do stick around for each page.

It could be solved by adding a option like attachOnlyOnce: true maybe. :)

@instagramlover
Copy link
Author

i dont like this way , the author of the lib has to provide a fix for this with big Thanks for hem for sure !

@craftpip
Copy link
Owner

Thanks for pointing the issue @snap608 , i should be checking if the events are already binded. Will fix asap.

@instagramlover

  1. as @snap608 pointed out, its because multiple events are attached, this is to be fixed.
  2. Yes, its a bug
  3. Yes, look for the changes that were made between the versions.
    If the changes are breaking older versions i will surely point it out in the release notes.

craftpip added a commit that referenced this issue Aug 9, 2017
@historylife
Copy link

Dear @craftpip , please can you explain this :


function popupalert(title, text, reload) {
      $.alert({
          title: title,
          content: text,
          confirmButton: 'Ok',
          boxWidth: '30%',
          useBootstrap: false,
          icon: 'ui large red warning circle icon',
          animation: 'zoom',
          buttons: {
              close: {
                  btnClass: 'btn-blue',
                  action: function() {
                      if (reload) {
                          location.reload();
                      }
                  }
              }
          }
      })
  }


$(".globalbody").on("touchend mousedown", ".add_mor_time_sign", function() {
              popupalert('Error!', 'There is no enough time in your global account balance Please <b><a href="https://instaranker.com/prices/">Buy more time</a></b>!', false);
  })

the problem still available !

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

4 participants