Menu

#616 (ok 3.4.0-rc1) Better AJAX message animation

Work_in_progress
closed-accepted
Interface (183)
1
2011-04-16
2011-04-02
No

I've found that in the latest git, some of the AJAX message animation is not shown correctly if it has been shown some times on the same page.

Way to reproduce this (with the ajax option enabled in the preferences):
1. on the home page, click Privileges menu
2. click "Add a new User" or "Edit Privileges" link, and it will display a new popup dialog
3. close the popup dialog by pressing Esc or click close button on the top right corner
4. repeat step 2 and 3 until several times (for me, it is about 3 - 5 times), and you'll see that the AJAX loading message will never show up again even the AJAX request is on progress

After some googlings, I found that jQuery clearQuery function used in latest git, will only stop current animation and remove queued animation as well. But, left current animation value unchange. (i.e., unfinished fadeOut animation, will left "opacity" attribute < 1 and > 0)

This is what creates the "not showing up" AJAX message. I suggest to use stop(true, true) function [1] to solve this.

[1] http://api.jquery.com/stop/

Discussion

  • Aris Feryanto

    Aris Feryanto - 2011-04-02

    Also, in the latest git, if I click on the "Edit Privileges", and then click "Go" button on the Global Privileges, I cannot read the AJAX message shown, because it disappeared too quickly. And this is solved in this patch.

    I uploaded the initial patch, which patch only the "Privileges" page. If phpMyAdmin developers okay with this patch, I will continue to patch all other pages.

     
  • Marc Delisle

    Marc Delisle - 2011-04-02
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2011-04-02

    Aris,
    I'm currently replacing the animation removing code by a single function (better not to duplicate code) so I'll try your idea.

     
  • Marc Delisle

    Marc Delisle - 2011-04-02

    Works well so I'll apply your idea (with you as author) on the resulting PMA_ajaxRemoveMessage() function after I'm done.

     
  • Marc Delisle

    Marc Delisle - 2011-04-02
    • priority: 5 --> 1
    • summary: Better AJAX message animation --> (ok 3.4.0-rc1) Better AJAX message animation
    • status: open --> open-accepted
     
  • Marc Delisle

    Marc Delisle - 2011-04-02

    Your patch was merged in the repository, thanks.

     
  • Rouslan Placella

    Marc, you gave me credit for the patch, instead of Aris by mistake. I wonder if you can ammend that...

     
  • Marc Delisle

    Marc Delisle - 2011-04-02

    Thanks Rouslan, I have tried to amend but am not satisfied with the result.

     
  • Aris Feryanto

    Aris Feryanto - 2011-04-02

    Hi, Marc. Thanks for the merge. No problem with the unchanged amendment. :)

    However, I've pulled the latest git and found that "clearQueue()" function in file "functions.js" is still not replaced with "stop(true, true)" function. Are you do this accidentally?

     
  • Marc Delisle

    Marc Delisle - 2011-04-02

    Pulled from which repository? It's there on the Sourceforge repo.

     
  • Aris Feryanto

    Aris Feryanto - 2011-04-02

    Yes, from the sourceforge repo. In the following code:

    function PMA_ajaxShowMessage(message, timeout) {
    ...
    else {
    //Otherwise, just show the div again after inserting the message
    $("#loading")
    .clearQueue()
    .html(msg)
    .fadeIn('medium')
    .delay(to)
    .fadeOut('medium', function() {
    $(this)
    .html("")
    .hide();
    })
    }
    ...
    }

     
  • Marc Delisle

    Marc Delisle - 2011-04-02

    Ok, I had not seen this one and I was not seeing a problem with current master.

    I just changed this instance; too bad we cannot easily reuse PMA_ajaxRemoveMessage().

     
  • Aris Feryanto

    Aris Feryanto - 2011-04-02

    Ok, thank you.

    With the previous code, we cannot see the AJAX notification message (either error or success notification) because it disappeared too quickly, as mentioned in my first comment below. And now, the AJAX notification message is showed correctly for the specified timeout.

     
  • Tyron Madlener

    Tyron Madlener - 2011-04-05

    This also fixed the immediately disappearing success message when submitting the 'edit privilege' dialog.

     
  • Marc Delisle

    Marc Delisle - 2011-04-16
    • status: open-accepted --> closed-accepted