Commit 34d59929 authored by liujiaxin's avatar liujiaxin

feat: custom formula input

parent 4d9a6bcd
......@@ -8,6 +8,7 @@ import {
OnInit, Output,
ViewChild
} from '@angular/core';
import {fromEvent, Observable, Subscription} from 'rxjs';
declare global {
interface Window {
......@@ -18,6 +19,9 @@ declare global {
}
}
@Component({
selector: 'app-formula-input',
templateUrl: './formula-input.component.html',
......@@ -36,6 +40,10 @@ export class FormulaInputComponent implements OnInit, OnChanges, OnDestroy, Afte
@Output() ngfBlur = new EventEmitter();
FB_id = 'FormulaBoard';
private esc: Subscription;
constructor() {
......@@ -78,23 +86,25 @@ export class FormulaInputComponent implements OnInit, OnChanges, OnDestroy, Afte
id: this.FB_id,
path: 'assets/formula-board/',
options: {
width: 600,
mode: 'android',
width: 1920,
mode: 'pc',
bottom: false,
}});
document.addEventListener('documentMessage', (e) => {
// @ts-ignore
if (e.detail.type === 'common.setFormula') {
const {type} = e.detail;
if (type === 'common.setFormula') {
// @ts-ignore
const {formula} = e.detail.data.body;
console.log(formula);
window.FBOARD.clear();
// @ts-ignore
window.__tmp_fp_input_model__.updateValue(formula);
const fb = document.getElementById(this.FB_id);
fb.style.visibility = 'hidden';
this.ngfBlur.emit();
window.FBOARD.editor.style.visibility = 'hidden';
this.ngfBlur.emit();
}
if (type === 'common.closeModal') {
window.FBOARD.editor.style.visibility = 'hidden';
}
});
}
......
This diff is collapsed.
......@@ -15,6 +15,8 @@
/*visibility: visible!important;*/
/*position: relative!important;*/
transition: none;
transform: scale(.8)!important;
transform-origin: left top!important;
}
.kf-placeholder{
display: none!important;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment