append date to the clipboard entry, and use it for sorting entries in the UI.

This commit is contained in:
Niels Lyngsø
2020-08-20 10:27:14 +02:00
parent 4c0d05e4ea
commit 19037d0a89
3 changed files with 61 additions and 50 deletions

View File

@@ -27,7 +27,7 @@
}
}
}
clipboardService.registrerClearPropertyResolver(clearNestedContentPropertiesForStorage)
@@ -49,7 +49,7 @@
}
}
}
clipboardService.registrerClearPropertyResolver(clearInnerNestedContentPropertiesForStorage)
}]);
@@ -245,6 +245,7 @@
_.each(singleEntriesForPaste, function (entry) {
vm.overlayMenu.pasteItems.push({
type: "elementType",
date: entry.date,
name: entry.label,
data: entry.data,
icon: entry.icon
@@ -255,12 +256,17 @@
_.each(arrayEntriesForPaste, function (entry) {
vm.overlayMenu.pasteItems.push({
type: "elementTypeArray",
date: entry.date,
name: entry.label,
data: entry.data,
icon: entry.icon
});
});
vm.overlayMenu.pasteItems.sort( (a, b) => {
return b.date - a.date
});
vm.overlayMenu.title = labels.grid_addElement;
vm.overlayMenu.hideHeader = vm.overlayMenu.pasteItems.length > 0;