lsc 2 vuotta sitten
vanhempi
commit
98cb40ef80
1 muutettua tiedostoa jossa 10 lisäystä ja 8 poistoa
  1. 10 8
      js/Desktop/DeskTop.js

+ 10 - 8
js/Desktop/DeskTop.js

@@ -2794,12 +2794,14 @@ U.MD.D.I.openApplicationJie = function (str, cid, stage, task, tool) {
                 _iframe.contentWindow.document.body.appendChild(script2);
                 _iframe.contentWindow.document.body.appendChild(script4);
             })
-        } else if (str == 'MindMap') {
+        } else if (str == 'mind') {
             U.UF.DL.iframeLoad(_iframe, async function () {
                 let _content = await U.MD.D.I.getContent(cid, stage, task, tool, _userid, '2')
-                _iframe.contentWindow.editor.minder.importData('json', _content).then(function(data){
-                    $(fileInput).val('');
-                });
+                if (_content) {
+                    _iframe.contentWindow.editor.minder.importData('json', _content).then(function (data) {
+                        $(fileInput).val('');
+                    });
+                }
                 _iframe.contentWindow.document.body.appendChild(script1);
                 _iframe.contentWindow.document.body.appendChild(script2);
                 _iframe.contentWindow.document.body.appendChild(script4);
@@ -2884,7 +2886,7 @@ U.MD.D.I.openApplicationJie = function (str, cid, stage, task, tool) {
 
 }
 
-U.MD.D.I.getEditorContent = function(iframe){
+U.MD.D.I.getEditorContent = function (iframe) {
     return new Promise((resolve, reject) => {
         iframe.contentWindow.editor.minder.exportData('json').then(function (content) {
             console.log(content);
@@ -2897,10 +2899,10 @@ U.MD.D.I.getContent = async function (cid, s, task, t, uid, type) {
     return new Promise((resolve, reject) => {
         U.A.Request(US.Config.pbl + "selectWord2?uid=" + uid + "&cid=" + cid + "&s=" + s + "&task=" + task + "&t=" + t + "&type=" + type, [], function (res) {
             if (res.value[0].length > 0) {
-         
+
                 resolve(res.value[0][0].text);
-                
-          
+
+
             }
         }, [], { "type": "GET", "withCredentials": true });
     });