nextcloud/core/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
..
files Fix sorting of favorite files 2017-07-05 15:01:23 +02:00
login Update login flow redirection 2017-05-04 19:21:22 +02:00
public Use dot notation for array access - JSLint recommendation 2017-05-01 00:45:41 -03:00
systemtags Fix some long lines in JS - JSLinut recommendation 2017-05-01 00:49:00 -03:00
tests Update setupchecks.js 2017-05-31 13:41:45 +02:00
apps.js Remove padding from apps navigation if there is no settings area 2016-11-23 18:41:35 +01:00
backgroundjobs.js Use tooltip for background jobs info tooltip 2016-07-13 13:01:17 +02:00
config.js Make AppConfig part of the public API 2016-10-21 09:09:23 +02:00
contactsmenu.js Localize contacts menu search input placeholder 2017-06-14 10:29:36 +02:00
core.json add contactsmenu popover 2017-04-26 09:26:53 +02:00
eventsource.js Encode requesttoken 2015-02-16 20:28:30 +01:00
installation.js load showpassord.js conditionally in the template only if needed 2014-12-16 18:45:37 +01:00
integritycheck-failed-notification.js Allow to dismiss the code integrity warning 2016-10-20 11:33:29 +02:00
jquery-showpassword.js Fix semicolon at end of JS lines 2017-05-01 00:42:53 -03:00
jquery-ui-fixes.js Fix semicolon at end of JS lines 2017-05-01 00:42:53 -03:00
jquery.avatar.js Fix tests 2017-03-29 22:54:08 +02:00
jquery.contactsmenu.js handle 404 separately 2017-04-26 09:30:21 +02:00
jquery.ocdialog.js move more sizing logic to css 2016-11-28 14:05:46 +01:00
js.js Merge pull request #5244 from nextcloud/dynamic-percentual-appmenu-limit 2017-06-14 11:36:04 -05:00
l10n.js Harden t() with DOMPurify 2017-03-16 14:17:42 +01:00
login.js bring back dedicated log in button to make log in more usable 2016-10-06 16:48:10 +02:00
lostpassword.js Disable the API endpoints as well 2017-05-11 17:03:57 +02:00
maintenance-check.js Use OC.webroot instead of calculating the URL 2015-05-11 17:01:57 +02:00
merged-login.json Merge login JS 2017-03-24 21:18:24 +01:00
merged-share-backend.json Merge sharing backend JS 2017-03-24 20:17:38 +01:00
merged-template-prepend.json add contactsmenu popover 2017-04-26 09:26:53 +02:00
mimetype.js Theming: Code cleanup and cache buster for mime icons 2016-11-18 10:23:24 +01:00
mimetypelist.js bycatch, x-ldif entry was missing 2017-06-14 11:47:44 +02:00
multiselect.js Users page lazy multiselect group dropdowns 2016-08-29 13:34:13 +02:00
oc-backbone-webdav.js Backbone Webdav Adapter MKCOL support 2017-03-17 00:08:48 -06:00
oc-backbone.js Backbone transport for Webdav 2016-01-16 11:28:04 +01:00
oc-dialogs.js Merge pull request #4610 from nextcloud/js-semicolons 2017-05-01 16:55:35 +02:00
oc-requesttoken.js Do not add sensitive request headers for cross domain requests 2015-09-15 11:42:13 +02:00
octemplate.js Fix variable definitions in oc dialogs 2017-05-01 01:09:29 -03:00
placeholder.js Fix semicolon at end of JS lines 2017-05-01 00:42:53 -03:00
select2-toggleselect.js Added system tags GUI in sidebar 2016-01-19 16:24:26 +01:00
setup.js Fix semicolon at end of JS lines 2017-05-01 00:42:53 -03:00
setupchecks.js Update setupchecks.js 2017-05-31 13:41:45 +02:00
share.js Merge pull request #4611 from nextcloud/js-use-dot-notation 2017-05-02 21:44:44 +02:00
shareconfigmodel.js allow admin to enforce password on mail shares 2017-04-20 16:33:26 +02:00
sharedialogexpirationview.js Fix some jshint issues in core/js/share* 2016-08-19 21:03:25 +02:00
sharedialoglinkshareview.js Remove the char because it breaks the export from transifex 2017-06-12 16:30:08 +02:00
sharedialogresharerinfoview.js Fix escaping of user and group names in "shared by" message 2017-06-13 12:14:21 +02:00
sharedialogshareelistview.js rename secure drop back to files drop because of name collision with securedrop.org 2017-05-18 16:55:58 +02:00
sharedialogview.js Fix variable definition in sharedialogview.js 2017-05-01 01:32:54 -03:00
shareitemmodel.js Make files drop more permanent 2017-05-04 00:30:51 +02:00
sharesocialmanager.js Allow social sharing to specify if a new window is opened 2017-04-20 16:32:46 +02:00
singleselect.js Fix semicolon at end of JS lines 2017-05-01 00:42:53 -03:00
update.js Spacing 2017-03-15 06:35:40 +00:00
visitortimezone.js Save the timezone on login again 2016-12-08 10:45:24 +01:00