|
@@ -1297,21 +1297,22 @@ export const appendPopupPage = (params = {}) => {
|
|
|
iframe.id = 'de-popup-page';
|
|
|
iframe.src = chrome.runtime.getURL('/iframe/popup-page.html') + `#${path}`;
|
|
|
iframe.style.cssText = `border: medium none; width: 375px;
|
|
|
- height: 600px;position: fixed; right: 16px; top: 16px;background: #FFFFFF;border: 0.5px solid #919191;box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);box-sizing: border-box;z-index: 9000;
|
|
|
+ height: 650px;position: fixed; right: 16px; top: 16px;background: #FFFFFF;border: 0.5px solid #919191;box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);box-sizing: border-box;z-index: 90000;
|
|
|
animation-duration: 0.5s !important;
|
|
|
animation-timing-function: ease-in-out !important;
|
|
|
animation-fill-mode: forwards !important;
|
|
|
- transition: all 1s ease 0s !important;right: -385px;`
|
|
|
+ transition: all 1s ease 0s !important;right: -385px;transform: translateX(385px);`
|
|
|
let iframeContent = document.getElementById('de-popup-page');
|
|
|
|
|
|
let overlayDom = document.createElement('div');
|
|
|
overlayDom.id = 'de-popup-overlay';
|
|
|
- overlayDom.style.cssText = `position: fixed;z-index: 8888;top: 0;
|
|
|
+ overlayDom.style.cssText = `position: fixed;z-index: 88888;top: 0;
|
|
|
left: 0;width: 100%;height: 100%;opacity: 0;display: none`;
|
|
|
|
|
|
let overlay = document.getElementById('de-popup-overlay');
|
|
|
+ let body = document.querySelector('body');
|
|
|
|
|
|
- if (!iframeContent) {
|
|
|
+ if (!iframeContent && body) {
|
|
|
document.querySelector('body').appendChild(iframe);
|
|
|
if(!overlay) {
|
|
|
document.querySelector('body').appendChild(overlayDom);
|
|
@@ -1334,13 +1335,15 @@ export const showPopupPage = (params = {}) => {
|
|
|
|
|
|
let iframe = document.getElementById('de-popup-page');
|
|
|
if (iframe) {
|
|
|
- iframe.src = chrome.runtime.getURL('/iframe/popup-page.html') + `#${path}`;
|
|
|
+ if(path) {
|
|
|
+ iframe.src = chrome.runtime.getURL('/iframe/popup-page.html') + `#${path}`;
|
|
|
+ }
|
|
|
iframe.style.transform = 'translateX(-' + 395 + 'px)';
|
|
|
|
|
|
chrome.runtime.sendMessage({
|
|
|
actionType: "CONTENT_POPUP_PAGE_SHOW",
|
|
|
data: { }
|
|
|
- }, () => { })
|
|
|
+ }, () => { });
|
|
|
|
|
|
let overlay = document.getElementById('de-popup-overlay');
|
|
|
overlay.style.display = 'block';
|
|
@@ -1351,10 +1354,7 @@ export const hidePopupPage = () => {
|
|
|
let iframe = document.getElementById('de-popup-page');
|
|
|
if (iframe) {
|
|
|
iframe.style.transform = 'translateX(' + 385 + 'px)';
|
|
|
- chrome.runtime.sendMessage({
|
|
|
- actionType: "CONTENT_POPUP_PAGE_HIDE",
|
|
|
- data: { }
|
|
|
- }, () => { })
|
|
|
+
|
|
|
let overlay = document.getElementById('de-popup-overlay');
|
|
|
overlay.style.display = 'none';
|
|
|
}
|
|
@@ -1389,7 +1389,7 @@ const onBodyClick = () => {
|
|
|
if(window.location.href.indexOf('api.twitter.com') < 0) {
|
|
|
document.querySelector('body').addEventListener('click', function () {
|
|
|
console.log('click')
|
|
|
- hidePopupPage();
|
|
|
+ // hidePopupPage();
|
|
|
})
|
|
|
}
|
|
|
}
|