wenliming 2 лет назад
Родитель
Сommit
6963112ab5
1 измененных файлов с 23 добавлено и 3 удалено
  1. 23 3
      src/view/iframe/publish/tool-box/child/editor.vue

+ 23 - 3
src/view/iframe/publish/tool-box/child/editor.vue

@@ -161,15 +161,34 @@ const clickAppHandler = (params) => {
 }
 
 const openWindow = (params) => {
+  chrome.windows.getCurrent({},
+    function(window) {
+      if(window && window.state == "fullscreen") {
+        chrome.windows.update(window.id,{
+          state: 'normal'
+        }, function() {
+          setTimeout(() => {
+            createGuideWindow(params, true);
+          }, 1000)
+        })
+      } else {
+        createGuideWindow(params);
+      }
+  })
+};
+
+const createGuideWindow = (params, isUpdate = false) => {
   openWindowList = [];
   selectAppGuideData = {};
 
   let windowWith = window.innerWidth - 500;
   let guideUrl = chrome.runtime.getURL('/iframe/tool-box-guide.html');
+
   chrome.windows.create({
     width: windowWith,
     type: 'popup',
-    url: params.defaultUrl
+    url: params.defaultUrl,
+    state: 'normal'
   }, function (window) {
     openWindowList.push(window);
   })
@@ -177,7 +196,8 @@ const openWindow = (params) => {
     width: 500,
     type: 'popup',
     url: guideUrl,
-    left: windowWith
+    left: windowWith,
+    state: 'normal'
   }, function (window) {
     openWindowList.push(window);
   })
@@ -185,7 +205,7 @@ const openWindow = (params) => {
   if(params.guideData) {
     selectAppGuideData = JSON.parse(params.guideData);
   }
-};
+}
 
 const getAppList = () => {
   getAllPostEditorAppData({params: {}}).then(res => {