Browse Source

Revert "Up lint"

This reverts commit 1f5b69267b.
pull/4329/head
Artur Arseniev 4 years ago
parent
commit
72ef294caf
  1. 10
      src/abstract/View.ts
  2. 2
      src/canvas/index.ts
  3. 16
      src/canvas/model/Canvas.ts
  4. 8
      src/canvas/model/Frame.ts
  5. 18
      src/editor/index.ts
  6. 2
      src/editor/model/Editor.ts
  7. 4
      src/pages/model/Page.ts

10
src/abstract/View.ts

@ -1,17 +1,17 @@
import Backbone from 'backbone';
import Model from './Model';
import Module, { IBaseModule } from './Module';
import Backbone from "backbone";
import Model from "./Model";
import Module, { IBaseModule } from "./Module";
export default class View<
TModel extends Model = Model,
TElement extends Element = HTMLElement
> extends Backbone.View<TModel, TElement> {
protected get pfx() {
return (this.em.config as any).stylePrefix || '';
return (this.em.config as any).stylePrefix || "";
}
protected get ppfx() {
return this.pfx + this.config.stylePrefix || '';
return this.pfx + this.config.stylePrefix || "";
}
protected get module(): TModel extends Model<infer M>? M: unknown {

2
src/canvas/index.ts

@ -79,7 +79,7 @@ export default class CanvasModule extends Module<typeof defaults> {
* @private
*/
constructor(em: EditorModel) {
super(em, 'Canvas', defaults)
super(em, "Canvas", defaults)
this.canvas = new Canvas(this);
this.model = this.canvas;

16
src/canvas/model/Canvas.ts

@ -1,8 +1,8 @@
import { Model } from '../../abstract';
import { evPageSelect } from '../../pages';
import Frames from './Frames';
import Page from '../../pages/model/Page';
import CanvasModule from '..';
import { Model } from "../../abstract";
import { evPageSelect } from "../../pages";
import Frames from "./Frames";
import Page from "../../pages/model/Page";
import CanvasModule from "..";
export default class Canvas extends Model<CanvasModule> {
defaults() {
@ -24,9 +24,9 @@ export default class Canvas extends Model<CanvasModule> {
const { em, config } = module;
const { scripts, styles } = config;
super(module, {scripts, styles});
this.set('frames', new Frames(module))
this.listenTo(this, 'change:zoom', this.onZoomChange);
this.listenTo(em, 'change:device', this.updateDevice);
this.set("frames", new Frames(module))
this.listenTo(this, "change:zoom", this.onZoomChange);
this.listenTo(em, "change:device", this.updateDevice);
this.listenTo(em, evPageSelect, this._pageUpdated);
}

8
src/canvas/model/Frame.ts

@ -1,6 +1,6 @@
import { result, forEach, isEmpty, isString } from 'underscore';
import { Model } from '../../abstract';
import CanvasModule from '..';
import { Model } from "../../abstract";
import CanvasModule from "..";
import ComponentWrapper from '../../dom_components/model/ComponentWrapper';
import { isComponent, isObject } from '../../utils/mixins';
import FrameView from '../view/FrameView';
@ -84,7 +84,7 @@ export default class Frame extends Model<CanvasModule> {
}
get head(): {tag: string, attributes: any}[]{
return this.get('head');
return this.get("head");
}
onRemove() {
@ -121,7 +121,7 @@ export default class Frame extends Model<CanvasModule> {
}
setHead(value: {tag: string, attributes: any}[]) {
return this.set('head', [...value]);
return this.set("head", [...value]);
}
addHeadItem(item: {tag: string, attributes: any}) {

18
src/editor/index.ts

@ -54,15 +54,15 @@
* ## Methods
* @module Editor
*/
import { EventHandler } from 'backbone';
import { isUndefined } from 'underscore';
import { IBaseModule } from '../abstract/Module';
import CanvasModule from '../canvas';
import cash from '../utils/cash-dom';
import html from '../utils/html';
import defaults from './config/config';
import EditorModel from './model/Editor';
import EditorView from './view/EditorView';
import { EventHandler } from "backbone";
import { isUndefined } from "underscore";
import { IBaseModule } from "../abstract/Module";
import CanvasModule from "../canvas";
import cash from "../utils/cash-dom";
import html from "../utils/html";
import defaults from "./config/config";
import EditorModel from "./model/Editor";
import EditorView from "./view/EditorView";
export default class EditorModule implements IBaseModule<typeof defaults> {
constructor(config = {}, opts: any = {}) {

2
src/editor/model/Editor.ts

@ -822,7 +822,7 @@ export default class EditorModel extends Model {
}
setCurrentFrame(frameView?: FrameView) {
return this.set('currentFrame', frameView);
return this.set("currentFrame", frameView);
}
getCurrentFrame(): FrameView {

4
src/pages/model/Page.ts

@ -25,8 +25,8 @@ export default class Page extends Model {
['component', 'styles'].map((i) => this.unset(i));
}
const frms: any[] = props.frames || [defFrame];
const frames = new Frames(em.get('Canvas'),
frms?.map((model) => new Frame(em.get('Canvas'), model))
const frames = new Frames(em.get("Canvas"),
frms?.map((model) => new Frame(em.get("Canvas"), model))
);
frames.page = this;
this.set('frames', frames);

Loading…
Cancel
Save