feat: multiple selected notes panel
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
.flex-grow(
|
||||
ng-repeat='editor in self.editors'
|
||||
)
|
||||
editor-view(
|
||||
.h-full
|
||||
multiple-selected-notes-panel.h-full(
|
||||
app-state='self.appState'
|
||||
application='self.application'
|
||||
editor='editor'
|
||||
ng-if='self.state.showMultipleSelectedNotes'
|
||||
)
|
||||
.flex-grow.h-full(
|
||||
ng-if='!self.state.showMultipleSelectedNotes'
|
||||
ng-repeat='editor in self.editors'
|
||||
)
|
||||
editor-view(
|
||||
application='self.application'
|
||||
editor='editor'
|
||||
)
|
||||
|
||||
@@ -2,16 +2,31 @@ import { WebApplication } from '@/ui_models/application';
|
||||
import { WebDirective } from './../../types';
|
||||
import template from './editor-group-view.pug';
|
||||
import { Editor } from '@/ui_models/editor';
|
||||
import { PureViewCtrl } from '../abstract/pure_view_ctrl';
|
||||
|
||||
class EditorGroupViewCtrl {
|
||||
class EditorGroupViewCtrl extends PureViewCtrl<unknown, {
|
||||
showMultipleSelectedNotes: boolean
|
||||
}> {
|
||||
|
||||
private application!: WebApplication
|
||||
public editors: Editor[] = []
|
||||
|
||||
/* @ngInject */
|
||||
constructor($timeout: ng.ITimeoutService,) {
|
||||
super($timeout);
|
||||
this.state = {
|
||||
showMultipleSelectedNotes: false
|
||||
}
|
||||
}
|
||||
|
||||
$onInit() {
|
||||
this.application.editorGroup.addChangeObserver(() => {
|
||||
this.editors = this.application.editorGroup.editors;
|
||||
});
|
||||
this.autorun(() => {
|
||||
this.setState({
|
||||
showMultipleSelectedNotes: this.appState.notes.selectedNotesCount > 1
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +35,6 @@ export class EditorGroupView extends WebDirective {
|
||||
super();
|
||||
this.template = template;
|
||||
this.controller = EditorGroupViewCtrl;
|
||||
this.replace = true;
|
||||
this.controllerAs = 'self';
|
||||
this.bindToController = true;
|
||||
this.scope = {
|
||||
|
||||
Reference in New Issue
Block a user