chore: rename editor model to note controller

This commit is contained in:
Mo
2021-12-27 18:46:56 -06:00
parent 54e5fc9184
commit 15aea42d4f
12 changed files with 184 additions and 182 deletions

View File

@@ -6,9 +6,9 @@
)
.flex-grow.h-full(
ng-if='!self.state.showMultipleSelectedNotes'
ng-repeat='editor in self.editors'
ng-repeat='controller in self.controllers'
)
editor-view(
application='self.application'
editor='editor'
controller='controller'
)

View File

@@ -1,29 +1,31 @@
import { WebDirective } from './../../types';
import template from './editor-group-view.pug';
import { Editor } from '@/ui_models/editor';
import { NoteController } from '@/ui_models/note_controller';
import { PureViewCtrl } from '../abstract/pure_view_ctrl';
class EditorGroupViewCtrl extends PureViewCtrl<unknown, {
showMultipleSelectedNotes: boolean
}> {
public editors: Editor[] = []
class EditorGroupViewCtrl extends PureViewCtrl<
unknown,
{
showMultipleSelectedNotes: boolean;
}
> {
public controllers: NoteController[] = [];
/* @ngInject */
constructor($timeout: ng.ITimeoutService,) {
constructor($timeout: ng.ITimeoutService) {
super($timeout);
this.state = {
showMultipleSelectedNotes: false
showMultipleSelectedNotes: false,
};
}
$onInit() {
this.application.editorGroup.addChangeObserver(() => {
this.editors = this.application.editorGroup.editors;
this.application.noteControllerGroup.addChangeObserver(() => {
this.controllers = this.application.noteControllerGroup.noteControllers;
});
this.autorun(() => {
this.setState({
showMultipleSelectedNotes: this.appState.notes.selectedNotesCount > 1
showMultipleSelectedNotes: this.appState.notes.selectedNotesCount > 1,
});
});
}
@@ -37,7 +39,7 @@ export class EditorGroupView extends WebDirective {
this.controllerAs = 'self';
this.bindToController = true;
this.scope = {
application: '='
application: '=',
};
}
}