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

[stable15] Clean code and fix drop zone shadow #13982

Merged

Conversation

@danxuliu
Copy link
Member

@danxuliu danxuliu commented Feb 1, 2019

Backport of the code cleanups (for easier future backports) and the bug fix (but not the new feature) of #12917

How to test:

  • Open the files app
  • Create a new folder
  • Drag the folder to the trash bin in the navigation bar

Result with this pull request:
The background of the trash bin row is highlighted.

Result without this pull request:
The background of the trash bin row is not highlighted, so no feedback is given to the user to know that the folder can be dropped in the trash bin.

danxuliu and others added 11 commits Jan 31, 2019
Since 6ad7f32 SVG icons are directly embedded in "icons-vars.css", so
the starred trash icon is now loaded along with the regular trash icon
all at once. Therefore it is not needed to explicitly prefetch it using
a hidden div.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The "droppedOnTrash" event was being triggered when the file list was
initialized, but it should be triggered only when the user actually
drops a file on the trash bin.

Besides that, the event had no effect; only the file list handles it,
but as it was not triggered on any element it ended being triggered on
the document, and thus not handled. Moreover, even if it had been
triggered on the file list it would have been done before the handler
was set, so it would not have been handled anyway. And even if it had
been handled no data was provided, so the handler would have failed.

In conclusion, triggering the event there was not needed, and thus it
was removed.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
When a single file was dropped on the trash bin the file information was
gotten from the original element in the file list. When several files
were dropped on the trash bin the file information was gotten from the
helper elements being dragged around. The helper element also contain
the needed file information when a single file is being dragged, so the
handling was unified to always get the file information from the helper
elements.

As the handling of several files is the same as before there is still
the issue of only deleting those files shown in the drag helper instead
of all the selected files.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Copy link
Member

@rullzer rullzer left a comment

blocked till 15.0.3 is out

@rullzer
rullzer approved these changes Feb 8, 2019
Copy link
Member

@rullzer rullzer left a comment

Quick smoke tests was ok here

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Tested and works 👍

@MorrisJobke MorrisJobke merged commit 6ae8e99 into stable15 Feb 8, 2019
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/drone/pr the build failed
Details
@dco
DCO DCO
Details
@fixupbot
fixupbot No fixup commits found. The commit history is clean
Details
@MorrisJobke MorrisJobke deleted the stable15-12917-clean-code-and-fix-drop-zone-shadow branch Feb 8, 2019
@MorrisJobke MorrisJobke mentioned this pull request Feb 20, 2019
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants