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

[stable14] Fix opening a section again in the Files app #11995

Merged

Commits on Oct 23, 2018

  1. Fix indentation

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Oct 23, 2018
    Configuration menu
    Copy the full SHA
    ea047e3 View commit details
    Browse the repository at this point in the history
  2. Fix opening a section again in the Files app

    When a section is open in the Files app a "show" event is triggered.
    File list objects handle that event by reloading themselves, but only
    if the file list was shown at least once. However, the file list objects
    of plugins are created when the "show" event is triggered for the first
    time for their section; as the file list objects register their handler
    for the "show" event when they are created they never handle the first
    triggered "show" event, as the handler is set while that event is being
    already handled. Therefore, from the point of view of the handler, the
    second time that a "show" event was triggered it was seen as if the file
    list was shown for the first time, and thus it was not reloaded. Now the
    "shown" property is explicitly set for those file lists that are created
    while handling a "show" event, which causes them to be reloaded as
    expected when opening their section again.
    
    Note that it is not possible to just reload the file list whenever it is
    shown; the file list is reloaded also when the directory changes, and
    this can happen when the web page is initially loaded and the URL is
    parsed. In that case, if file lists were reloaded when shown for the
    first time then it could be reloaded twice, one with the default
    parameters due to the "show" event and another one with the proper
    parameters once the URL was parsed, and the files that appeard in the
    list would depend on which response from the server was received the
    last.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Oct 23, 2018
    Configuration menu
    Copy the full SHA
    7312566 View commit details
    Browse the repository at this point in the history
  3. Remove event handler no longer needed

    The custom handler for "URL changed" events were added to reload the
    file list whenever the sections for favorites and shares were opened;
    this was used to fix the problem of not reloading the file lists when
    opening them for a second time. However, besides that the handlers were
    not really necessary, and as the root of the bug was fixed in the
    previous commit those handlers are now removed.
    
    The file list for tags uses the handler for a different purpose, though,
    so that one was kept.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Oct 23, 2018
    Configuration menu
    Copy the full SHA
    9801b5a View commit details
    Browse the repository at this point in the history
  4. Add acceptance tests for opening a section in the Files app

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Oct 23, 2018
    Configuration menu
    Copy the full SHA
    c1e37bb View commit details
    Browse the repository at this point in the history