Sort session history by newest first
This commit is contained in:
@@ -15,8 +15,14 @@ class SessionHistoryMenu {
|
||||
$scope.autoOptimize = sessionHistory.autoOptimize;
|
||||
|
||||
$scope.reloadHistory = function() {
|
||||
$scope.history = sessionHistory.historyForItem($scope.item);
|
||||
let history = sessionHistory.historyForItem($scope.item);
|
||||
// make copy as not to sort inline
|
||||
$scope.entries = history.entries.slice(0).sort((a, b) => {
|
||||
return a.item.updated_at < b.item.updated_at ? 1 : -1;
|
||||
})
|
||||
$scope.history = history;
|
||||
}
|
||||
|
||||
$scope.reloadHistory();
|
||||
|
||||
$scope.openRevision = function(revision) {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
.sublabel
|
||||
Saving to disk may increase app loading time and memory footprint.
|
||||
|
||||
%menu-row{"ng-repeat" => "revision in history.entries",
|
||||
%menu-row{"ng-repeat" => "revision in entries",
|
||||
"action" => "openRevision(revision);",
|
||||
"label" => "revision.previewTitle()"}
|
||||
.sublabel.opaque{"ng-class" => "classForRevision(revision)"}
|
||||
|
||||
Reference in New Issue
Block a user