Commit b0dc80e3 authored by liujiaxin's avatar liujiaxin

feat: custom formula input

parent 5c209d10
......@@ -67,17 +67,18 @@ export class FormulaInputComponent implements OnInit, OnChanges, OnDestroy, Afte
window.__tmp_fp_input_model__ = this;
const rect = this.inputEl.nativeElement.getBoundingClientRect();
const fb = document.getElementById(this.FB_id);
fb.style.position = 'absolute';
let left = rect.left + rect.width;
let top = rect.top;
fb.style.position = 'fixed';
// @ts-ignore
const padWidth = $('#' + this.FB_id).outerWidth() * .8;
// @ts-ignore
const padHeight = $('#' + this.FB_id).outerHeight() * .8;
// @ts-ignore
const ww = $(window).innerWidth();
if ((left + padWidth) > ww) {
left = ww - padWidth;
top = top + rect.height;
}
// @ts-ignore
const hh = $(window).innerHeight();
const left = (ww - padWidth) / 2;
const top = (hh - padHeight) / 2;
console.log('left', left);
fb.style.left = left + 'px';
fb.style.top = top + 'px';
......
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