mylomen-server/static/js/lib/model/InnerStyle.js
shaoyongjun ab00b85c8f to:sync
2024-10-31 01:32:52 +08:00

53 lines
1.0 KiB
JavaScript

"use strict";
import {MyKV} from './MyKV.js'
export class InnerStyle {
constructor() {
this.nodeType = "p"
//map-> index:classList
this.childrenStyle = null;
//前置包围元素。 如 有序/无序列表
this.preStyle = null;
}
getNodeType() {
return this.nodeType
}
setNodeType(nodeType) {
this.nodeType = nodeType
}
setChildrenStyle(index, classList) {
if (this.childrenStyle === null) {
this.childrenStyle = new Map();
}
this.childrenStyle.set(index, classList)
}
getChildrenStyle(index) {
return this.childrenStyle.get(index);
}
//前置类型 如 ul ol 代码块 等
setPreStyle(k, v) {
if (this.preStyle == null) {
this.preStyle = new MyKV(k, v);
}
}
getPreStyle() {
return this.preStyle
}
getChildrenStyleMap() {
return this.childrenStyle;
}
setChildrenStyleMapNull() {
this.childrenStyle = null;
}
}