Add a '+ new' ghost icon in list mode and in anon drive

pull/1/head
yflory 4 years ago
parent f421a7099d
commit f612f3ad68

@ -552,6 +552,21 @@
.cp-app-drive-element { .cp-app-drive-element {
.cp-app-drive-element-truncated { display: none; } .cp-app-drive-element-truncated { display: none; }
} }
.cp-app-drive-new-ghost {
cursor: pointer;
opacity: 0.5;
padding: 0;
align-items: center;
justify-content: center;
display: inline-flex;
&:hover {
opacity: 0.7;
}
.fa, .cptools {
cursor: pointer;
}
}
div.cp-app-drive-content-grid { div.cp-app-drive-content-grid {
padding: 1em; padding: 1em;
ul { ul {
@ -598,27 +613,17 @@
} }
} }
} }
.cp-app-drive-element-list {
display: none;
}
.cp-app-drive-new-ghost { .cp-app-drive-new-ghost {
cursor: pointer;
opacity: 0.5;
padding: 0;
flex-flow: column; flex-flow: column;
align-items: center;
justify-content: center;
display: inline-flex;
&:hover {
opacity: 0.7;
}
.fa, .cptools { .fa, .cptools {
cursor: pointer;
font-size: 90px; font-size: 90px;
margin-top: 5px; margin-top: 5px;
margin-bottom: 0; margin-bottom: 0;
} }
} }
.cp-app-drive-element-list {
display: none;
}
} }
.cp-app-drive-content-list { .cp-app-drive-content-list {
@ -626,6 +631,10 @@
display: none; display: none;
} }
// Make it act as a table! // Make it act as a table!
.cp-app-drive-new-ghost {
padding: 0 5px;
margin-top: 20px;
}
padding-left: 10px; padding-left: 10px;
ul { ul {
width: 100%; width: 100%;

@ -3031,7 +3031,7 @@ define([
if (APP.$content.data('readOnlyFolder') || !APP.editable) { return; } if (APP.$content.data('readOnlyFolder') || !APP.editable) { return; }
var isInRoot = currentPath[0] === ROOT; var isInRoot = currentPath[0] === ROOT;
var $element = $('<li>', { var $element = $('<li>', {
'class': 'cp-app-drive-element-row cp-app-drive-element-grid cp-app-drive-new-ghost' 'class': 'cp-app-drive-element-row cp-app-drive-new-ghost'
}).prepend($addIcon.clone()).appendTo($list); }).prepend($addIcon.clone()).appendTo($list);
$element.append($('<span>', {'class': 'cp-app-drive-element-name'}) $element.append($('<span>', {'class': 'cp-app-drive-element-name'})
.text(Messages.fm_newFile)); .text(Messages.fm_newFile));
@ -3148,7 +3148,10 @@ define([
return; return;
} }
var allfiles = files[FILES_DATA]; var allfiles = files[FILES_DATA];
if (allfiles.length === 0) { return; } if (Object.keys(allfiles || {}).length === 0) {
createGhostIcon($container);
return;
}
var $fileHeader = getFileListHeader(true); var $fileHeader = getFileListHeader(true);
$container.append($fileHeader); $container.append($fileHeader);
var keys = manager.getFiles([FILES_DATA]); var keys = manager.getFiles([FILES_DATA]);

Loading…
Cancel
Save