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

Comments

Projects
None yet
4 participants
@instagramlover

instagramlover commented Jul 8, 2017

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

This comment has been minimized.

Show comment
Hide comment
@craftpip

craftpip Jul 9, 2017

Owner

Please post your code for clear understanding,

Owner

craftpip commented Jul 9, 2017

Please post your code for clear understanding,

@snap608

This comment has been minimized.

Show comment
Hide comment
@snap608

snap608 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. :)

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

This comment has been minimized.

Show comment
Hide comment
@instagramlover

instagramlover Jul 25, 2017

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

instagramlover commented Jul 25, 2017

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

This comment has been minimized.

Show comment
Hide comment
@craftpip

craftpip Jul 31, 2017

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.
Owner

craftpip commented Jul 31, 2017

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

This comment has been minimized.

Show comment
Hide comment
@historylife

historylife Sep 5, 2017

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 !

historylife commented Sep 5, 2017

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 !

@craftpip craftpip closed this Jan 20, 2018

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