Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added favorite-state to the dropshadow to disable the removal of an e…
…ntry from the list if it was already present

Signed-off-by: Felix Nüsse <[email protected]>
  • Loading branch information
newhinton authored and skjnldsv committed Oct 2, 2018
commit ea94eb556bbbe07f649a00fe00772559cf71c6be
3 changes: 2 additions & 1 deletion apps/files/js/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ var createDragShadow = function(event) {
var newtr = $('<tr/>')
.attr('data-dir', dir)
.attr('data-file', elem.name)
.attr('data-origin', elem.origin);
.attr('data-origin', elem.origin)
.attr('data-favorite', elem.tags.includes("_$!<Favorite>!$_"));
newtr.append($('<td class="filename" />').text(elem.name).css('background-size', 32));
newtr.append($('<td class="size" />').text(OC.Util.humanFileSize(elem.size)));
tbody.append(newtr);
Expand Down
3 changes: 3 additions & 0 deletions apps/files/js/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@
var $selectedFiles = $(ui.draggable);
if (ui.helper.find("tr").size()===1) {
var $tr = $selectedFiles.closest('tr');
if($tr.attr("data-favorite")){
return;
}
$selectedFiles.trigger("droppedOnFavorites", $tr.attr("data-file"));
}else{
OC.Notification.showTemporary(t('files', 'You can only add single Folders to the Favorites'));
Expand Down