bugfix
This commit is contained in:
parent
4fc8516c73
commit
48982ac6d9
@ -459,6 +459,8 @@ bricks.App = class extends bricks.Layout {
|
||||
this.session_id = null;
|
||||
this.tooltip = new bricks.Tooltip({otext:'test',i18n:true, wrap:true});
|
||||
this.add_widget(this.tooltip);
|
||||
this._Width = this.dom_element.offsetWidth;
|
||||
this._Height = this.dom_element.offsetHeight;
|
||||
}
|
||||
create(){
|
||||
this.dom_element = document.getElementsByTagName('body')[0];
|
||||
|
@ -383,18 +383,26 @@ bricks.Tooltip = class extends bricks.Text {
|
||||
this.set_otext(otext);
|
||||
this.set_style('zIndex', 999999999);
|
||||
this.set_style('display', 'block');
|
||||
var ex,ey;
|
||||
var x,y;
|
||||
x = event.clientX;
|
||||
y = event.clientY;
|
||||
if (x + this.dom_element.offsetWidth > bricks.Body.dom_element.clientWidth){
|
||||
x = bricks.Body.dom_element.clientWidth - this.dom_element.offsetWidth;
|
||||
var xsize = bricks.Body.dom_element.clientWidth;
|
||||
var ysize = bricks.Body.dom_element.clientHeight;
|
||||
ex = event.clientX;
|
||||
ey = event.clientY;
|
||||
var mxs = this.dom_element.offsetWidth;
|
||||
var mys = this.dom_element.offsetHeight;
|
||||
if (ex < (xsize / 2)) {
|
||||
x = ex + bricks.app.charsize;
|
||||
} else {
|
||||
x = ex - mxs - bricks.app.charsize;
|
||||
}
|
||||
if (y + this.dom_element.offsetHeight > bricks.Body.dom_element.clientHeight){
|
||||
y = bricks.Body.dom_element.clientHeight - this.dom_element.offsetHeight;
|
||||
if (ey < (ysize / 2)) {
|
||||
y = ey + bricks.app.charsize;
|
||||
} else {
|
||||
x = ey - mys - bricks.app.charsize;
|
||||
}
|
||||
this.set_style('left', x + 'px');
|
||||
this.set_style('top', y + 'px');
|
||||
console.log('moveover event happen');
|
||||
}
|
||||
hide(){
|
||||
console.log('moveout event happen');
|
||||
|
Loading…
Reference in New Issue
Block a user