Put view switching button to left.

This commit is contained in:
LucasYuNju
2016-09-09 23:26:14 +08:00
parent b0ebb26977
commit fbc39e7918
3 changed files with 45 additions and 0 deletions

View File

@@ -240,6 +240,10 @@ function log(o) {
<div class="pull-left" id="tagSearch" style="line-height: 38px"> <div class="pull-left" id="tagSearch" style="line-height: 38px">
</div> </div>
<div id="viewModeDropdown">
<span class="fa fa-th-list" title="Switch view"></span>
</div>
<div id="newMyNote"> <div id="newMyNote">
<a id="newNoteBtn" title="New note"> <a id="newNoteBtn" title="New note">
<span class="new-note-text" title="New note">+</span> <span class="new-note-text" title="New note">+</span>

View File

@@ -3221,6 +3221,38 @@ $(function() {
Notebook.searchNotebookForList(key); Notebook.searchNotebookForList(key);
}); });
// 切换列表视图
$("#viewModeDropdown").click(function() {
console.log("*******");
var themeSubmenus = new gui.Menu();
themeSubmenus.append(new gui.MenuItem({
checked: Config.view === "summary",
label: "摘要视图",
type: "checkbox",
click: function() {
Config.view = 'summary';
Notebook.renderCurNotebook();
Api.writeConfig(Config);
}
}));
themeSubmenus.append(new gui.MenuItem({
checked: Config.view === "list",
label: "列表视图",
type: "checkbox",
click: function() {
Config.view = 'list';
Notebook.renderCurNotebook();
Api.writeConfig(Config);
}
}));
var $this = $(this);
var x = $this.offset().left;
var y = $this.offset().top + $this.height();
themeSubmenus.popup(gui.getCurrentWindow(), Math.round(x), Math.round(y));
});
//--------------------------- //---------------------------
// 搜索, 按enter才搜索 // 搜索, 按enter才搜索
/* /*

View File

@@ -1448,6 +1448,15 @@ h3 {
.close:focus { .close:focus {
outline: none; outline: none;
} }
#viewModeDropdown {
width: 30px;
height:35px;
line-height: 30px;
text-align: center;
position: relative;
z-index: 10000;
cursor: pointer;
}
#newMyNote { #newMyNote {
position: absolute; position: absolute;
right: 3px; right: 3px;