fix popup shakes after pagination click

This commit is contained in:
Dawid Wysokiński 2020-07-21 15:53:42 +02:00
parent 6f8fcb1794
commit 5806adb2da
9 changed files with 61 additions and 30 deletions

View File

@ -267,15 +267,21 @@ var _default = function _default() {
html,
id
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
inlinePopup(e, id, null, {
offset_x: 0,
offset_y: 0
}, html, title);
const popup = document.querySelector(POPUP_SELECTOR);
if (popup) {
popup.style.width = 'auto';
popup.style.maxWidth = '800px';
popup.style.maxWidth = '1000px';
}
if (popup.classList.contains('show')) {
popup.querySelector('#inline_popup_title').innerHTML = title;
popup.querySelector('#inline_popup_content').innerHTML = html;
} else {
inlinePopup(e, id, null, {
offset_x: 0,
offset_y: 0
}, html, title);
}
const popupWrapper = document.querySelector(POPUP_WRAPPER_SELECTOR);
@ -1011,7 +1017,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedPlayerProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedPlayerProfile.js
// @version 1.0.5
// @version 1.0.8
// @description Extended Player Profile
// @author Kichiyaki http://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_player*

View File

@ -1148,15 +1148,21 @@ var _default = function _default() {
html,
id
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
inlinePopup(e, id, null, {
offset_x: 0,
offset_y: 0
}, html, title);
const popup = document.querySelector(POPUP_SELECTOR);
if (popup) {
popup.style.width = 'auto';
popup.style.maxWidth = '800px';
popup.style.maxWidth = '1000px';
}
if (popup.classList.contains('show')) {
popup.querySelector('#inline_popup_title').innerHTML = title;
popup.querySelector('#inline_popup_content').innerHTML = html;
} else {
inlinePopup(e, id, null, {
offset_x: 0,
offset_y: 0
}, html, title);
}
const popupWrapper = document.querySelector(POPUP_WRAPPER_SELECTOR);
@ -1715,7 +1721,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedTribeProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedTribeProfile.js
// @version 0.9.2
// @version 0.9.5
// @description Extended Tribe Profile
// @author Kichiyaki http://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_ally*

View File

@ -303,15 +303,21 @@ var _default = function _default() {
html,
id
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
inlinePopup(e, id, null, {
offset_x: 0,
offset_y: 0
}, html, title);
const popup = document.querySelector(POPUP_SELECTOR);
if (popup) {
popup.style.width = 'auto';
popup.style.maxWidth = '800px';
popup.style.maxWidth = '1000px';
}
if (popup.classList.contains('show')) {
popup.querySelector('#inline_popup_title').innerHTML = title;
popup.querySelector('#inline_popup_content').innerHTML = html;
} else {
inlinePopup(e, id, null, {
offset_x: 0,
offset_y: 0
}, html, title);
}
const popupWrapper = document.querySelector(POPUP_WRAPPER_SELECTOR);
@ -594,7 +600,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedVillageProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedVillageProfile.js
// @version 0.5.2
// @version 0.5.5
// @description Extended Village Profile
// @author Kichiyaki http://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_village*

View File

@ -175,15 +175,21 @@ var _default = function _default() {
html,
id
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
inlinePopup(e, id, null, {
offset_x: 0,
offset_y: 0
}, html, title);
const popup = document.querySelector(POPUP_SELECTOR);
if (popup) {
popup.style.width = 'auto';
popup.style.maxWidth = '800px';
popup.style.maxWidth = '1000px';
}
if (popup.classList.contains('show')) {
popup.querySelector('#inline_popup_title').innerHTML = title;
popup.querySelector('#inline_popup_content').innerHTML = html;
} else {
inlinePopup(e, id, null, {
offset_x: 0,
offset_y: 0
}, html, title);
}
const popupWrapper = document.querySelector(POPUP_WRAPPER_SELECTOR);
@ -492,7 +498,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/latestEnnoblements.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/latestEnnoblements.js
// @version 1
// @version 1.0.3
// @description Show the latest ennoblements
// @author Kichiyaki http://dawid-wysokinski.pl/ | Icon author *GD*
// @match *://*/game.php*

View File

@ -21,7 +21,7 @@ import { setItem, getItem } from './utils/localStorage';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedPlayerProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedPlayerProfile.js
// @version 1.0.5
// @version 1.0.8
// @description Extended Player Profile
// @author Kichiyaki http://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_player*

View File

@ -23,7 +23,7 @@ import { formatPlayerURL as formatPlayerURLTribalWars } from './utils/tribalwars
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedTribeProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedTribeProfile.js
// @version 0.9.2
// @version 0.9.5
// @description Extended Tribe Profile
// @author Kichiyaki http://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_ally*

View File

@ -9,7 +9,7 @@ import showEnnoblementsPopup from './utils/showEnnoblementsPopup';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedVillageProfile.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/extendedVillageProfile.js
// @version 0.5.2
// @version 0.5.5
// @description Extended Village Profile
// @author Kichiyaki http://dawid-wysokinski.pl/
// @match *://*/game.php*screen=info_village*

View File

@ -16,7 +16,7 @@ import loadTranslations from './i18n/latestEnnoblements';
// @namespace https://github.com/tribalwarshelp/scripts
// @updateURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/latestEnnoblements.js
// @downloadURL https://raw.githubusercontent.com/tribalwarshelp/scripts/master/dist/latestEnnoblements.js
// @version 1
// @version 1.0.3
// @description Show the latest ennoblements
// @author Kichiyaki http://dawid-wysokinski.pl/ | Icon author *GD*
// @match *://*/game.php*

View File

@ -2,12 +2,19 @@ const POPUP_WRAPPER_SELECTOR = '.popup_helper';
const POPUP_SELECTOR = '#inline_popup';
export default ({ e, title, html, id } = {}) => {
inlinePopup(e, id, null, { offset_x: 0, offset_y: 0 }, html, title);
const popup = document.querySelector(POPUP_SELECTOR);
if (popup) {
popup.style.width = 'auto';
popup.style.maxWidth = '800px';
popup.style.maxWidth = '1000px';
}
if (popup.classList.contains('show')) {
popup.querySelector('#inline_popup_title').innerHTML = title;
popup.querySelector('#inline_popup_content').innerHTML = html;
} else {
inlinePopup(e, id, null, { offset_x: 0, offset_y: 0 }, html, title);
}
const popupWrapper = document.querySelector(POPUP_WRAPPER_SELECTOR);
if (popupWrapper) {
popupWrapper.style.width = 'auto';