mirror of https://github.com/keeweb/keeweb.git
fix
This commit is contained in:
parent
7730486f30
commit
6606fa8108
|
@ -30,7 +30,11 @@ class View extends EventEmitter {
|
|||
return;
|
||||
}
|
||||
|
||||
this.debugLogger && this.debugLogger.debug('Render start');
|
||||
let ts;
|
||||
if (this.debugLogger) {
|
||||
this.debugLogger.debug('Render start');
|
||||
ts = this.debugLogger.ts();
|
||||
}
|
||||
|
||||
if (this.el) {
|
||||
Tip.destroyTips(this.el);
|
||||
|
@ -42,7 +46,7 @@ class View extends EventEmitter {
|
|||
|
||||
Tip.createTips(this.el);
|
||||
|
||||
this.debugLogger && this.debugLogger.debug('Render finished');
|
||||
this.debugLogger && this.debugLogger.debug('Render finished', this.debugLogger.ts(ts));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
@ -69,7 +73,9 @@ class View extends EventEmitter {
|
|||
el.innerHTML = html;
|
||||
const root = el.firstChild;
|
||||
if (this.options.ownParent) {
|
||||
parent.appendChild(root);
|
||||
if (root) {
|
||||
parent.appendChild(root);
|
||||
}
|
||||
this.el = parent;
|
||||
} else {
|
||||
this.el = root;
|
||||
|
@ -161,6 +167,7 @@ class View extends EventEmitter {
|
|||
}
|
||||
|
||||
toggle(visible) {
|
||||
this.debugLogger && this.debugLogger.debug(visible ? 'Show' : 'Hide');
|
||||
if (visible === undefined) {
|
||||
visible = this.hidden;
|
||||
}
|
||||
|
|
|
@ -45,9 +45,9 @@ class AppView extends View {
|
|||
super(model);
|
||||
this.views.menu = new MenuView(this.model.menu, { ownParent: true });
|
||||
this.views.menuDrag = new DragView('x', { parent: '.app__menu-drag' });
|
||||
this.views.footer = new FooterView(this.model);
|
||||
this.views.listWrap = new ListWrapView(this.model);
|
||||
this.views.list = new ListView(this.model);
|
||||
this.views.footer = new FooterView(this.model, { ownParent: true });
|
||||
this.views.listWrap = new ListWrapView(this.model, { ownParent: true });
|
||||
this.views.list = new ListView(this.model, { ownParent: true });
|
||||
this.views.listDrag = new DragView('x', { parent: '.app__list-drag' });
|
||||
this.views.list.dragView = this.views.listDrag;
|
||||
this.views.details = new DetailsView();
|
||||
|
|
|
@ -20,8 +20,8 @@ class FooterView extends View {
|
|||
'click .footer__btn-lock': 'lockWorkspace'
|
||||
};
|
||||
|
||||
constructor(model) {
|
||||
super(model);
|
||||
constructor(model, options) {
|
||||
super(model, options);
|
||||
|
||||
this.onKey(Keys.DOM_VK_L, this.lockWorkspace, KeyHandler.SHORTCUT_ACTION, false, true);
|
||||
this.onKey(Keys.DOM_VK_G, this.genPass, KeyHandler.SHORTCUT_ACTION);
|
||||
|
|
|
@ -44,8 +44,8 @@ class ListView extends View {
|
|||
{ val: 'fileName', name: 'file', enabled: false }
|
||||
];
|
||||
|
||||
constructor(model) {
|
||||
super(model);
|
||||
constructor(model, options) {
|
||||
super(model, options);
|
||||
|
||||
this.initScroll();
|
||||
this.views.search = new ListSearchView(this.model);
|
||||
|
|
|
@ -3,15 +3,17 @@ import { View } from 'view-engine/view';
|
|||
class ListWrapView extends View {
|
||||
parent = '.app__list-wrap';
|
||||
|
||||
template = () => '';
|
||||
|
||||
events = {};
|
||||
|
||||
constructor(model) {
|
||||
super(model);
|
||||
constructor(model, options) {
|
||||
super(model, options);
|
||||
this.listenTo(this.model.settings, 'change:tableView', this.setListLayout);
|
||||
}
|
||||
|
||||
render() {
|
||||
this.el = document.querySelector(this.parent);
|
||||
super.render();
|
||||
this.setListLayout();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue