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
merged 11 commits into from Feb 8, 2019

Conversation

Projects
None yet
4 participants
@danxuliu
Copy link
Member

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.

newhinton and others added some commits Dec 7, 2018

Extract variable for yellow color in icons
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Fix drop zone shadow
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Remove hack to prefetch the starred trash icon
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>
Remove leftover from a WIP
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Remove duplicated variable declaration
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Remove unneeded triggering of event
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>
Add missing trailing ";"
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Replace double quotes with single quotes
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Make code format more consistent with the rest of the file
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Use full names instead of abbreviations in variable names
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Unify handling of dropping one file or several files on the trash bin
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>

@danxuliu danxuliu added this to the Nextcloud 15.0.4 milestone Feb 1, 2019

@danxuliu danxuliu requested review from rullzer , MorrisJobke , skjnldsv and newhinton Feb 1, 2019

@rullzer
Copy link
Member

rullzer left a comment

blocked till 15.0.3 is out

@rullzer

rullzer approved these changes Feb 8, 2019

Copy link
Member

rullzer left a comment

Quick smoke tests was ok here

@MorrisJobke
Copy link
Member

MorrisJobke left a comment

Tested and works 👍

@MorrisJobke MorrisJobke merged commit 6ae8e99 into stable15 Feb 8, 2019

1 check failed

continuous-integration/drone/pr the build failed
Details

@MorrisJobke MorrisJobke deleted the stable15-12917-clean-code-and-fix-drop-zone-shadow branch Feb 8, 2019

@MorrisJobke MorrisJobke referenced this pull request Feb 20, 2019

Merged

15.0.5 RC 1 #14304

4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.