Repository navigation
Conversation
|
@PVince81 What do you think? |
There was a problem hiding this comment.
Please use triple equal === for type safety.
|
@pdessauw thanks for the PR. A few comments:
|
There was a problem hiding this comment.
Try not using global selectors.
Once you have moved this code to the FileList class you can use this.$el to access that element, so the right part will become this.$el.scrollTop().
|
I haven't tested this yet, here are a few questions:
It should probably highlight ALL the uploaded files, but only scroll to the last one as we can't scroll to multiple files 😄 I'll test this once you've made the above changes 😄 |
There was a problem hiding this comment.
Same here with triple equals.
Also I think you don't need to escape the slash, so "\/" becomes '/' (we usually use single quotes from strings)
|
OK, my JS editor was wrongly setup, I corrected that. I will implement all the design advice you gave me. Multiple files is working but only highlight the last uploaded file, I will also change that. |
|
I submitted the changes. I created 2 different functions: 1 to scroll, the other to highlight all the uploaded files. Let me know what you're thinking of the new version. |
There was a problem hiding this comment.
Just noticed that we also need to make sure we don't get infinite loops here in case the file is still not found.
I suggest to change _nextPage to return true when a page was appended and false when there are no more pages. This way you'll be able to jump out of this loop/function if the file name is never found for some reason.
There was a problem hiding this comment.
I corrected this portion of code but I can't figure out a proper test to be sure that there is no infinite loop. @PVince81 do you have any suggestion about it?
|
@pdessauw thanks for making the changes. It is a big improvement 😄 |
|
FYI: I updated the title to be more descriptive. |
|
🚀 Test Passed. 🚀 |
|
Thanks for the JSHint advice, I have installed it. Way better now :). I'll take care of the last few things and let you know once it is done. |
|
@pdessauw did you find the time to work on this? I don't want to duplicate the effort but am eager to finish this... |
|
I added the regression tag because the PR goes a long way fixing owncloud-archive/apps#1882 and #10028 - the scrollto feature, used to find and scroll to a file in the filelist. |
|
Yeah, I got busy and forgot to finish this work. It shouldn't be too long to produce a correct pull request. I'm on it! |
|
🚀 Test Passed. 🚀 |
There was a problem hiding this comment.
This is actually wrong. You are expecting an array in the form [{name:'file1.txt'},{name:'file2.txt'}].
Ideally this function should accept an array of strings like ['file1.txt', 'file2.txt'].
Then in the upload.js file you can call it using _.pluck(files, 'name'). This will automatically flatten the array by picking all name properties.
There was a problem hiding this comment.
This comment is linked to the one below. As requested, I pluck the array in the file-upload.js, thus, I didn't have to change anything from this part of the code. The function is now working accordingly to the documentation. Is there anything I should change?
There was a problem hiding this comment.
Ah I see. I don't see anything bad in the code, and since you have two reviews already, I think you can merge it :)
There was a problem hiding this comment.
Yes, this is already fixed.
|
It does work now, thanks. Also: can you add some padding in the scrolling calculation ? I see that when it scrolls down the highlighted file is directly at the top of the list. It might look nice if you could at this point see one or two rows above it. |
|
@pdessauw any news ? 😄 |
|
A new inspection was created. |
|
🚀 Test Passed. 🚀 |
|
@PVince81 I made some changes:
I defined an inner function (highlightRow) in filelist.js which is called for each row. I did that because of the setTimeout which uses a new function each time it is called and JSLint was ranting about using it in the loop over files. I am not sure about the correctness of doing that, if it needs to be modified, let me know. |
|
The code looks good, going to test it again. |
|
Very nice, great work! 👍 from me @owncloud/designers please check it out (@enoch85 ?) Needs a second reviewer @icewind1991 @th3fallen |
|
👍 |
Scroll to uploaded file in file list
|
Is this really a regression? If yes: should this be backported? |
|
please backport |
|
It is a regression introduced by the "render on scroll" feature (aka infinite scroll) for which it wasn't possible to use the same mechanism to automatically scroll down since the element didn't exist yet. I'll take care of the backport |
|
Backported to stable7 as 919d19c |
|
@owncloud/designers have you reviewed the highlight animation ? |
When files are uploaded, the cursor scrolls down to the last one and make it blink.
fixes #733