Remove user styling in editor again for now
This commit is contained in:
parent
594fc9bebd
commit
fe87f986d3
@ -460,7 +460,6 @@ class EditingContainer extends HTMLDivElement {
|
||||
editingArea: EditingArea;
|
||||
|
||||
baseStylesheet: CSSStyleSheet;
|
||||
userStyle: HTMLStyleElement;
|
||||
|
||||
connectedCallback(): void {
|
||||
this.className = "field";
|
||||
@ -497,11 +496,6 @@ class EditingContainer extends HTMLDivElement {
|
||||
0
|
||||
);
|
||||
|
||||
this.userStyle = this.editingShadow.appendChild(
|
||||
document.createElement("style")
|
||||
);
|
||||
this.userStyle.setAttribute("rel", "stylesheet");
|
||||
|
||||
this.editingArea = this.editingShadow.appendChild(
|
||||
document.createElement("editing-area")
|
||||
) as EditingArea;
|
||||
@ -526,11 +520,6 @@ class EditingContainer extends HTMLDivElement {
|
||||
firstRule.style.direction = direction;
|
||||
}
|
||||
|
||||
setUserStyling(css: HTMLStyleElement): void {
|
||||
this.userStyle.parentNode.replaceChild(css, this.userStyle);
|
||||
this.userStyle = css;
|
||||
}
|
||||
|
||||
isRightToLeft(): boolean {
|
||||
return this.editingArea.style.direction === "rtl";
|
||||
}
|
||||
@ -584,10 +573,6 @@ class EditorField extends HTMLDivElement {
|
||||
setBaseStyling(fontFamily: string, fontSize: string, direction: string): void {
|
||||
this.editingContainer.setBaseStyling(fontFamily, fontSize, direction);
|
||||
}
|
||||
|
||||
setUserStyling(css: HTMLStyleElement): void {
|
||||
this.editingContainer.setUserStyling(css);
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("editor-field", EditorField, { extends: "div" });
|
||||
@ -648,16 +633,6 @@ function setFonts(fonts: [string, number, boolean][]): void {
|
||||
});
|
||||
}
|
||||
|
||||
function setUserStyling(css: string): void {
|
||||
const userStyle = document.createElement("style");
|
||||
userStyle.setAttribute("rel", "stylesheet");
|
||||
userStyle.innerHTML = css;
|
||||
|
||||
forField([], (_, field) => {
|
||||
field.setUserStyling(userStyle.cloneNode(true) as HTMLStyleElement);
|
||||
});
|
||||
}
|
||||
|
||||
function setNoteId(id: number): void {
|
||||
currentNoteId = id;
|
||||
}
|
||||
|
@ -504,10 +504,9 @@ class Editor:
|
||||
self.web.setFocus()
|
||||
gui_hooks.editor_did_load_note(self)
|
||||
|
||||
js = "setFields(%s); setFonts(%s); setUserStyling(%s); focusField(%s); setNoteId(%s)" % (
|
||||
js = "setFields(%s); setFonts(%s); focusField(%s); setNoteId(%s)" % (
|
||||
json.dumps(data),
|
||||
json.dumps(self.fonts()),
|
||||
json.dumps(self.note.model()["css"]),
|
||||
json.dumps(focusTo),
|
||||
json.dumps(self.note.id),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user