Quellcode durchsuchen

improve the pupup config

tags/2.6.1
Caven Chen vor 4 Jahren
Ursprung
Commit
343cd019ae
1 geänderte Dateien mit 12 neuen und 2 gelöschten Zeilen
  1. 12
    2
      modules/widget/type/Popup.js

+ 12
- 2
modules/widget/type/Popup.js Datei anzeigen

@@ -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;

Laden…
Abbrechen
Speichern