Skip to content

duplication problem #290

Closed
Closed

Description

@instagramlover

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

Activity

  1. craftpip commented on Jul 9, 2017

    @craftpip
    Owner

    Please post your code for clear understanding,

  2. snap608 commented on Jul 25, 2017

    @snap608

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

  3. instagramlover commented on Jul 25, 2017

    @instagramlover
    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 !

  4. craftpip commented on Jul 31, 2017

    @craftpip
    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.
  5. added a commit that references this issue on Aug 9, 2017
  6. historylife commented on Sep 5, 2017

    @historylife

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions