mirror of https://github.com/TriliumNext/Notes
mobile layout fixes
parent
ed1b5e3843
commit
f15239c006
@ -0,0 +1,18 @@
|
||||
import BasicWidget from "./basic_widget.js";
|
||||
|
||||
const TPL = `
|
||||
<button type="button" class="close-detail-button action-button d-sm-none d-md-none d-lg-none d-xl-none" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>`;
|
||||
|
||||
class CloseDetailButtonWidget extends BasicWidget {
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
|
||||
//this.$widget.find('.close-detail-button').on('click', );
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
}
|
||||
|
||||
export default CloseDetailButtonWidget;
|
||||
@ -0,0 +1,46 @@
|
||||
import BasicWidget from "./basic_widget.js";
|
||||
import appContext from "../services/app_context.js";
|
||||
import contextMenu from "../services/context_menu.js";
|
||||
import noteCreateService from "../services/note_create.js";
|
||||
import branchService from "../services/branches.js";
|
||||
|
||||
const TPL = `<button type="button" class="action-button bx bx-menu"></button>`;
|
||||
|
||||
class MobileDetailMenuWidget extends BasicWidget {
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
|
||||
this.$widget.on("click", async e => {
|
||||
const note = appContext.tabManager.getActiveTabNote();
|
||||
|
||||
contextMenu.show({
|
||||
x: e.pageX,
|
||||
y: e.pageY,
|
||||
items: [
|
||||
{ title: "Insert child note", command: "insertChildNote", uiIcon: "plus",
|
||||
enabled: note.type !== 'search' },
|
||||
{ title: "Delete this note", command: "delete", uiIcon: "trash",
|
||||
enabled: note.noteId !== 'root' }
|
||||
],
|
||||
selectMenuItemHandler: async ({command}) => {
|
||||
if (command === "insertChildNote") {
|
||||
noteCreateService.createNote(note.noteId);
|
||||
}
|
||||
else if (command === "delete") {
|
||||
if (await branchService.deleteNotes(note.getBranchIds()[0])) {
|
||||
// move to the tree
|
||||
togglePanes();
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new Error("Unrecognized command " + command);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
}
|
||||
|
||||
export default MobileDetailMenuWidget;
|
||||
Loading…
Reference in New Issue