mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-17 00:15:12 +00:00
notes sorter
This commit is contained in:
@@ -224,10 +224,6 @@ function log(o) {
|
||||
<div id="noteList">
|
||||
<div class="clearfix" id="notesAndSort" style="position: relative">
|
||||
|
||||
<a id="sortType">
|
||||
<i class="fa fa-sort-amount-desc"></i>
|
||||
</a>
|
||||
|
||||
<!-- 我的笔记本 -->
|
||||
<div id="myNotebookNavForListNav">
|
||||
<span id="curNotebookForListNote" class="lang">Newest</span>
|
||||
|
@@ -137,8 +137,17 @@ Note.notebookHasNotes = function(notebookId) {
|
||||
// sortType = dateCreatedASC dateCreatedDESC
|
||||
Note.setNotesSorter = function (sortType) {
|
||||
Config.sortType = sortType;
|
||||
|
||||
// 如果当前是tagSearch, search, star 怎么办?
|
||||
// 重新Render
|
||||
if (Notebook.isTag || Notebook.isStarred || Notebook.isSearch) {
|
||||
Note.renderNotesAndTargetNote(Note._everNotes, false, false);
|
||||
} else {
|
||||
// 其实这里也可以用Note._everNotes, 主要是为了缓存数据
|
||||
Notebook.changeNotebook(Notebook.curNotebookId);
|
||||
}
|
||||
// Note.renderNotesAndTargetNote(Note._everNotes, false, false);
|
||||
|
||||
Api.writeConfig(Config);
|
||||
};
|
||||
|
||||
@@ -1026,6 +1035,9 @@ Note.renderNotes = function(notes, forNewNote, hasSorted) {
|
||||
this.clearSeqForNew();
|
||||
this.batch.reset();
|
||||
|
||||
// 为了切换排序方式用
|
||||
Note._everNotes = notes;
|
||||
|
||||
// 手机端不用
|
||||
// slimScroll使得手机端滚动不流畅
|
||||
if (!LEA.isMobile && !Mobile.isMobile()) {
|
||||
@@ -3285,7 +3297,7 @@ $(function() {
|
||||
var noteViewMenus = new gui.Menu();
|
||||
noteViewMenus.append(new gui.MenuItem({
|
||||
checked: Config.view === "snippet",
|
||||
label: Api.getMsg("Snippet view"),
|
||||
label: Api.getMsg("Snippet View"),
|
||||
type: "checkbox",
|
||||
click: function() {
|
||||
Note.switchView('snippet');
|
||||
@@ -3293,15 +3305,13 @@ $(function() {
|
||||
}));
|
||||
noteViewMenus.append(new gui.MenuItem({
|
||||
checked: Config.view === "list",
|
||||
label: Api.getMsg("List view"),
|
||||
label: Api.getMsg("List View"),
|
||||
type: "checkbox",
|
||||
click: function() {
|
||||
Note.switchView('list');
|
||||
}
|
||||
}));
|
||||
noteViewMenus.append(new gui.MenuItem({
|
||||
type: "separator"
|
||||
}));
|
||||
noteViewMenus.append(new gui.MenuItem({type: "separator"}));
|
||||
noteViewMenus.append(new gui.MenuItem({
|
||||
checked: Config.sortType == "dateCreatedASC",
|
||||
label: Api.getMsg("Date Created - ASC"),
|
||||
@@ -3318,6 +3328,7 @@ $(function() {
|
||||
Note.setNotesSorter('dateCreatedDESC');
|
||||
}
|
||||
}));
|
||||
noteViewMenus.append(new gui.MenuItem({type: "separator"}));
|
||||
noteViewMenus.append(new gui.MenuItem({
|
||||
checked: Config.sortType == "dateUpdatedASC",
|
||||
label: Api.getMsg("Date Updated - ASC"),
|
||||
@@ -3334,6 +3345,7 @@ $(function() {
|
||||
Note.setNotesSorter('dateUpdatedDESC');
|
||||
}
|
||||
}));
|
||||
noteViewMenus.append(new gui.MenuItem({type: "separator"}));
|
||||
noteViewMenus.append(new gui.MenuItem({
|
||||
checked: Config.sortType == "titleASC",
|
||||
label: Api.getMsg("Title - ASC"),
|
||||
|
@@ -788,6 +788,11 @@ Notebook.changeCurNotebookTitle = function(title, isStarred, subTitle, isTag, is
|
||||
me.isStarred = isStarred;
|
||||
me.isTag = isTag;
|
||||
me.isSearch = isSearch;
|
||||
if (isTag) {
|
||||
$('#myNotebookNavForListNav').addClass('tag-title');
|
||||
} else {
|
||||
$('#myNotebookNavForListNav').removeClass('tag-title');
|
||||
}
|
||||
};
|
||||
|
||||
// 笔记列表与编辑器的mask loading
|
||||
|
@@ -1974,21 +1974,21 @@ function setMacTopMenu() {
|
||||
label: getMsg('Toggle DevTools'),
|
||||
accelerator: isMac_ ? 'Alt+Command+I' : 'Ctrl+I',
|
||||
click: function() { gui.win.toggleDevTools(); }
|
||||
}, {
|
||||
}/*, {
|
||||
type: 'separator'
|
||||
}, {
|
||||
label: Api.getMsg('Snippet view'),
|
||||
label: Api.getMsg('Snippet View'),
|
||||
// type: "checkbox",
|
||||
click: function() {
|
||||
Note.switchView('snippet');
|
||||
},
|
||||
}, {
|
||||
label: Api.getMsg('List view'),
|
||||
label: Api.getMsg('List View'),
|
||||
// type: "checkbox",
|
||||
click: function() {
|
||||
Note.switchView('list');
|
||||
},
|
||||
}, ]
|
||||
}, */]
|
||||
}, {
|
||||
label: 'Window',
|
||||
submenu: [{
|
||||
|
@@ -51,7 +51,7 @@ TagNav.prototype = {
|
||||
NoteService.searchNoteByTag(tag, function(notes) {
|
||||
hideLoading();
|
||||
if(notes) {
|
||||
Note.renderNotes(notes);
|
||||
// Note.renderNotes(notes);
|
||||
Note.renderNotesAndTargetNote(notes, noteId);
|
||||
}
|
||||
});
|
||||
|
@@ -316,8 +316,8 @@
|
||||
"Open": "打开",
|
||||
"Close": "关闭",
|
||||
|
||||
"Snippet view": "摘要视图",
|
||||
"List view": "列表视图",
|
||||
"Snippet View": "摘要视图",
|
||||
"List View": "列表视图",
|
||||
|
||||
"Network error, please check out your network.": "网络异常, 请检查网络或稍后再试",
|
||||
"You need to sign in Leanote": "您需要重新登录Leanote",
|
||||
|
@@ -314,8 +314,8 @@
|
||||
"Open": "打開",
|
||||
"Close": "關閉",
|
||||
|
||||
"Snippet view": "摘要視圖",
|
||||
"List view": "列表視圖",
|
||||
"Snippet View": "摘要視圖",
|
||||
"List View": "列表視圖",
|
||||
|
||||
"Network error, please check out your network.": "網絡異常, 請檢查網絡或稍後再試",
|
||||
"You need to sign in Leanote": "您需要重新登錄Leanote",
|
||||
|
@@ -1628,7 +1628,7 @@ h3 {
|
||||
left: 55px;
|
||||
right: 55px;
|
||||
text-align: center;
|
||||
font-style: 16px;
|
||||
font-size: 16px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
@@ -1636,6 +1636,9 @@ h3 {
|
||||
span {
|
||||
cursor: default;
|
||||
}
|
||||
&.tag-title {
|
||||
line-height: 29px;
|
||||
}
|
||||
}
|
||||
|
||||
#searchNote {
|
||||
|
Reference in New Issue
Block a user