nextcloud/apps/files/js
Daniel Calviño Sánchez be56374c51 Fix sorting of favorite files
The sort comparator checks the "isFavorite" property of the FileInfo
objects to compare. That property is set when the file list is loaded
and the response from the server is parsed, and thus a freshly loaded
file list has the proper sorting for favorite files. However, the
property is not set in other cases, like when the FileInfo objects are
derived from FileInfoModels due to a file being marked as a favorite or
a text editor being closed, which causes the file to be sorted in the
wrong position.

There is no need to add the property in those situations, though; in all
cases the TagsPlugin adds a "tags" array property that contains an
OC.TAG_FAVORITE tag, so that tag can be checked instead of "isFavorite".
Moreover, although "isFavorite" was added by the main "_parseFileInfo"
function it did not really belong there but to the "FileInfoParser" from
the TagsPlugin; however, as that property now is not used anywhere it
was removed altogether.

A cleaner solution would have been to make the sort comparator
extensible by plugins like other behaviours of the file list and then
add the sorting logic related to favorite files to the TagsPlugin.
However, right now only the TagsPlugin would need to alter the main
sorting logic, and it seems like a corner case anyway. Even if it is
implemented as a plugin, favorite files is a core feature, so for the
time being it will be taken into account directly in the main sorting
logic; making the sort comparator extensible by plugins is defered until
there are other use cases for that.

Fixes #5410

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-07-05 15:01:23 +02:00
..
templates Upload autorename on client side 2016-11-02 22:15:03 +01:00
admin.js Do not error on maxUploadChange 2016-08-22 20:25:58 +02:00
app.js Put the quota bar to the bottom 2017-06-13 11:17:45 +02:00
breadcrumb.js Replace deprecated $.tipsy(...) by $.tooltip(...) 2017-02-27 22:25:05 +01:00
detailfileinfoview.js Make file actions work from sidebar 2015-08-12 17:30:20 +02:00
detailsview.js Make possible to know the registered detail views in a details view 2017-06-09 03:14:23 +02:00
detailtabview.js Hide sidebar tab headers conditionally 2015-09-28 14:57:44 +02:00
favoritesfilelist.js properly reload favorites list 2017-04-21 14:20:34 +02:00
favoritesplugin.js Properly join path sections 2015-11-22 16:05:51 +01:00
file-upload.js Fix uploadrate value of 'original-title' attribute 2017-06-16 15:35:51 +08:00
fileactions.js use more fitting icon for files move action 2016-10-17 18:52:25 +02:00
fileactionsmenu.js Make file actions use icon CSS classes 2016-02-25 22:49:52 +01:00
fileinfomodel.js added quit option in commentstabview.js 2017-03-23 13:12:29 -06:00
filelist.js Fix sorting of favorite files 2017-07-05 15:01:23 +02:00
files.js Fix #5349, no themed icon when dragging folder 2017-06-13 17:11:05 +02:00
filesummary.js Translate file summary connector (#26221) 2016-09-27 18:38:56 +02:00
gotoplugin.js Fix closing details view when viewing file in folder 2017-04-25 17:45:42 +02:00
jquery-visibility.js update jquery-visibility in files app 2015-08-17 09:39:21 +02:00
jquery.fileupload.js properly fix folder upload to use delegatedEvent 2016-06-14 11:51:03 +02:00
keyboardshortcuts.js Fixed many issues, clean up 2014-05-15 17:51:04 +02:00
mainfileinfodetailview.js Trigger pre and post render events in MainFileInfoDetailsView 2017-06-09 08:43:53 +02:00
merged-index.json Merge file view JS files 2017-03-24 19:42:22 +01:00
navigation.js Only set the active item when there is one (not the case for quota) 2017-06-13 11:17:44 +02:00
newfilemenu.js Make new file file tooltip error text change 2017-05-21 08:23:17 +05:45
recentfilelist.js block user sorting in recent files 2016-07-22 15:20:55 +02:00
recentplugin.js Add recent file listing 2016-07-22 15:20:51 +02:00
search.js Use proper mime icons for search results 2017-05-16 14:30:49 +02:00
sidebarpreviewmanager.js allow registering sidebar preview handlers for mimetypes that dont come with server side previews 2016-12-01 15:43:17 +01:00
sidebarpreviewtext.js remove js debug statements in sidebar text preview generator 2016-11-30 14:54:54 +01:00
tagsplugin.js share api expanded by tags (#26583) 2017-04-11 11:54:13 -05:00
upload.js Improved Javascript docs for JSDoc 2014-10-31 13:43:30 +01:00