Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 10 additions & 1 deletion apps/files/css/files.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@
.nav-icon-favorites {
@include icon-color('star-dark', 'actions', $color-black, 2, true);
}

.nav-icon-favorites-starred {
@include icon-color('star-dark', 'actions', $color-yellow, 2, true);
}

.nav-icon-sharingin,
.nav-icon-sharingout,
.nav-icon-shareoverview {
Expand Down Expand Up @@ -693,7 +698,11 @@ table.dragshadow td.size {

.breadcrumb .canDrop > a,
#filestable tbody tr.canDrop {
background-color: rgb(179, 230, 255);
background-color: rgba( $color-primary, .3 );
}

.dropzone-background {
background-color: rgba( $color-primary, .3 );
}


Expand Down
6 changes: 6 additions & 0 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@

this.$fileList.on('click','td.filename>a.name, td.filesize, td.date', _.bind(this._onClickFile, this));

$.event.trigger({type: "droppedOnFavorites"});
var self=this;
this.$fileList.on("droppedOnFavorites", function (event, file) {
self.fileActions.triggerAction('Favorite', self.getModelForFile(file), self);
});

this.$fileList.on('change', 'td.selection>.selectCheckBox', _.bind(this._onClickFileCheckbox, this));
this.$el.on('show', _.bind(this._onShow, this));
this.$el.on('urlChanged', _.bind(this._onUrlChanged, this));
Expand Down
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
31 changes: 31 additions & 0 deletions apps/files/js/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,37 @@
var list = quickAccessMenu.getElementsByTagName('li');
this.QuickSort(list, 0, list.length - 1);
}

var favListElement=$(quickAccessMenu).parent();
favListElement.append("<div class='nav-icon-favorites-starred'></div>")
favListElement.droppable({
over: function( event, ui ) {
favListElement.addClass('dropzone-background')
},
out: function( event, ui ) {
favListElement.removeClass('dropzone-background');
},
activate: function( event, ui ) {
var elem=favListElement.find("a").first();
elem.addClass('nav-icon-favorites-starred').removeClass('nav-icon-favorites');
},
deactivate: function( event, ui ) {
var elem=favListElement.find("a").first();
elem.addClass('nav-icon-favorites').removeClass('nav-icon-favorites-starred');
},
drop: function( event, ui ) {
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
4 changes: 2 additions & 2 deletions core/css/icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,13 @@ img, object, video, button, textarea, input, select, div[contenteditable='true']
&:focus {
@include icon-color('star', 'actions', $color-black, 1, true);
}
@include icon-color('star-dark', 'actions', 'FC0', 1, true);
@include icon-color('star-dark', 'actions', $color-yellow, 1, true);
}

.icon-star {
&:hover,
&:focus {
@include icon-color('star-dark', 'actions', 'FC0', 1, true);
@include icon-color('star-dark', 'actions', $color-yellow, 1, true);
}
}

Expand Down
1 change: 1 addition & 0 deletions core/css/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ $color-success: #46ba61;
// used for svg
$color-white: #fff;
$color-black: #000;
$color-yellow: #FC0;

// rgb(118, 118, 118) / #767676
// min. color contrast for normal text on white background according to WCAG AA
Expand Down