Browse Source

improve the pupup config

tags/2.6.1
Caven Chen 4 years ago
parent
commit
343cd019ae
1 changed files with 12 additions and 2 deletions
  1. 12
    2
      modules/widget/type/Popup.js

+ 12
- 2
modules/widget/type/Popup.js View File

@@ -80,11 +80,21 @@ class Popup extends Widget {
_updateWindowCoord(windowCoord) {
let x = windowCoord.x - this._wrapper.offsetWidth / 2
let y = windowCoord.y - this._wrapper.offsetHeight
if (this._config && this._config.position === 'left') {

if (this._config.position === 'topleft') {
x = windowCoord.x
y = windowCoord.y
} else if (this._config.position === 'topright') {
x = windowCoord.x - this._wrapper.offsetWidth
} else if (this._config && this._config.position === 'right') {
y = windowCoord.y
} else if (this._config.position === 'bottomleft') {
x = windowCoord.x
y = windowCoord.y - this._wrapper.offsetHeight
} else if (this._config.position === 'bottomright') {
x = windowCoord.x - this._wrapper.offsetWidth
y = windowCoord.y - this._wrapper.offsetHeight
}

this._wrapper.style.cssText = `
visibility:visible;
z-index:1;

Loading…
Cancel
Save