diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-10-17 11:59:13 +0200 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2013-10-17 12:55:10 +0200 |
commit | 467f864db4de3b2d0341edc9788c31a7f723fb4d (patch) | |
tree | 5abbe5963677edc55393669de9dfeaa2ec9b80de /apps/files/js/fileactions.js | |
parent | ea4f6e2431f8545a71022916ac530d994803e99c (diff) | |
download | nextcloud-server-467f864db4de3b2d0341edc9788c31a7f723fb4d.tar.gz nextcloud-server-467f864db4de3b2d0341edc9788c31a7f723fb4d.zip |
Fixed sharing status update for new/uploaded files
Creating new files, folders or uploading files now have their sharing
icon updated accordingly.
For this, the global share status list that is cached in
OC.Share.statuses is reused for new files.
Performance should improve as the sharing list is now only loaded once
per navigation session.
In OC.Share, split loadIcons into loadIcons + updateIcons.
Fixes #4977
Diffstat (limited to 'apps/files/js/fileactions.js')
-rw-r--r-- | apps/files/js/fileactions.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index e14e52eb6ca..03e23189a97 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -61,7 +61,13 @@ var FileActions = { var actions = this.get(mime, type, permissions); return actions[name]; }, - display: function (parent) { + /** + * Display file actions for the given element + * @param parent "td" element of the file for which to display actions + * @param triggerEvent if true, triggers the fileActionsReady on the file + * list afterwards (false by default) + */ + display: function (parent, triggerEvent) { FileActions.currentFile = parent; var actions = FileActions.get(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions()); var file = FileActions.getCurrentFile(); @@ -137,6 +143,10 @@ var FileActions = { element.on('click', {a: null, elem: parent, actionFunc: actions['Delete']}, actionHandler); parent.parent().children().last().append(element); } + + if (triggerEvent){ + $('#fileList').trigger(jQuery.Event("fileActionsReady")); + } }, getCurrentFile: function () { return FileActions.currentFile.parent().attr('data-file'); |