fragment: dome doc + save as fragment mode

This commit is contained in:
bordun 2021-04-15 16:24:54 +02:00
parent f35c3cf523
commit 44f43cb144
13 changed files with 85 additions and 5 deletions

View file

@ -50,6 +50,11 @@ var menuEntries = [
shortcut: 'mod + shift + s',
class: ()=>{return READ_ONLY || sessionManager.session === null ? 'disabled' :''}
},
{
label: locales('fragment_mode'),
class: ()=>{return 'toggle ' + (sessionManager.saveMode === 'fragment' ? 'on' : 'off')},
action: ()=>{sessionManager.setSaveMode(sessionManager.saveMode === 'session' ? 'fragment' : 'session')}
},
{
separator: true
},

View file

@ -4,6 +4,8 @@ var UiWidget = require('./ui-widget'),
Sortable = require('sortablejs'),
morph = require('nanomorph'),
locales = require('../locales'),
raw = require('nanohtml/raw'),
{icon} = require('./utils'),
Root, Panel, Matrix, Keyboard, widgetManager,
init = false
@ -20,6 +22,7 @@ class UiTree extends UiWidget {
super(options)
this.mounted = false
this.container.appendChild(html`<div class="fragment-mode-warning" title="${locales('fragment_mode_explanation')}">${raw(icon('exclamation-triangle'))} ${locales('fragment_mode_warning')}</div>`)
this.filter = this.container.appendChild(html`<input class="filter" type="text" placeholder="${locales('tree_filter')}..."/>`)
this.list = this.container.appendChild(html`<ol style="--depth: 1"></ol`)
this.dragDummy = html`<span></span>`