Browse Source

Fix pfx issues

pull/4327/head
Alex Ritter 4 years ago
parent
commit
6221ee727a
  1. 2
      src/abstract/DomainViews.ts
  2. 4
      src/abstract/View.ts
  3. 1
      src/canvas/view/FrameView.ts
  4. 10
      src/canvas/view/FramesView.ts

2
src/abstract/DomainViews.ts

@ -44,7 +44,7 @@ export default abstract class DomainViews<TCollection extends Backbone.Collectio
* @private
* */
private add(model: TModel<TCollection>, fragment?: DocumentFragment) {
const { config, reuseView, viewCollection, itemsView = {} } = this;
const { reuseView, viewCollection, itemsView = {} } = this;
var frag = fragment || null;
var typeField = model.get(this.itemType);
let view;

4
src/abstract/View.ts

@ -7,11 +7,11 @@ export default class View<
TElement extends Element = HTMLElement
> extends Backbone.View<TModel, TElement> {
protected get pfx() {
return (this.em.config as any).stylePrefix || "";
return this.ppfx + this.config.stylePrefix || "";
}
protected get ppfx() {
return this.pfx + this.config.stylePrefix || "";
return (this.em.config as any).stylePrefix || "";
}
protected get module(): TModel extends Model<infer M>? M: unknown {

1
src/canvas/view/FrameView.ts

@ -411,6 +411,7 @@ export default class FrameView extends View<Frame, HTMLIFrameElement> {
model: component,
config: {
...component.config,
em,
frameView: this,
},
}).render();

10
src/canvas/view/FramesView.ts

@ -1,3 +1,4 @@
import CanvasModule from '..';
import DomainViews from '../../abstract/DomainViews';
import Frames from '../model/Frames';
import CanvasView from './CanvasView';
@ -5,11 +6,14 @@ import FrameWrapView from './FrameWrapView';
export default class FramesView extends DomainViews<Frames, FrameWrapView> {
canvasView: CanvasView;
private _module: CanvasModule;
constructor(opts = {}, config: any) {
super(opts, true);
//console.log(this.collection)
this.listenTo(this.collection, 'reset', this.render);
this.canvasView = config.canvasView
this._module = config.module;
}
onRemoveBefore(items: FrameWrapView[], opts = {}) {
@ -17,10 +21,8 @@ export default class FramesView extends DomainViews<Frames, FrameWrapView> {
}
onRender() {
const { $el, em } = this;
em && $el.attr({ class: `${em.config.stylePrefix}frames` });
const { $el, ppfx } = this;
$el.attr({ class: `${ppfx}frames` });
}
protected renderView(item: any, type: string){return new FrameWrapView(item, this.canvasView)}
}
//FramesView.prototype.itemView = FrameWrapView;

Loading…
Cancel
Save