未验证 提交 3d35383c 编写于 作者: O openharmony_ci 提交者: Gitee

!5922 【轻量级 PR】:【OpenHarmony开源贡献者计划2022】更正js-apis-window 代码中的语法错误

Merge pull request !5922 from gloria/N/A
...@@ -545,10 +545,10 @@ display.getDefaultDisplay((err, data) => { ...@@ -545,10 +545,10 @@ display.getDefaultDisplay((err, data) => {
displayClass = data; displayClass = data;
window.minimizeAll(displayClass.id, (err, data) => { window.minimizeAll(displayClass.id, (err, data) => {
if(err.code) { if(err.code) {
console.error('Failed to minimize all window. Cause: ' + JSON.stringify(err)); console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Succeeded in minimizing all window.'); console.info('Succeeded in minimizing all windows.');
}); });
}); });
``` ```
...@@ -588,9 +588,9 @@ display.getDefaultDisplay((err, data) => { ...@@ -588,9 +588,9 @@ display.getDefaultDisplay((err, data) => {
displayClass = data; displayClass = data;
let promise = window.minimizeAll(displayClass.id); let promise = window.minimizeAll(displayClass.id);
promise.then((data)=> { promise.then((data)=> {
console.info('Succeeded in minimizing all window.'); console.info('Succeeded in minimizing all windows.');
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to minimize all window. Cause: ' + JSON.stringify(err)); console.error('Failed to minimize all windows. Cause: ' + JSON.stringify(err));
}) })
}); });
``` ```
...@@ -2606,11 +2606,11 @@ class myAbility extends Ability { ...@@ -2606,11 +2606,11 @@ class myAbility extends Ability {
var windowClass = null; var windowClass = null;
windowStage.createSubWindow("mySubWindow", (err, data) => { windowStage.createSubWindow("mySubWindow", (err, data) => {
if (err.code) { if (err.code) {
console.error('Failed to create sub window. Cause: ' + JSON.stringify(err)); console.error('Failed to create the subwindow. Cause: ' + JSON.stringify(err));
return; return;
} }
windowClass = data; windowClass = data;
console.info('Succeeded in create sub window. Data: ' + JSON.stringify(data)); console.info('Succeeded in creating the subwindow. Data: ' + JSON.stringify(data));
windowClass.resetSize(500, 1000); windowClass.resetSize(500, 1000);
}); });
} }
...@@ -2649,9 +2649,9 @@ class myAbility extends Ability { ...@@ -2649,9 +2649,9 @@ class myAbility extends Ability {
let promise = windowStage.createSubWindow("mySubWindow"); let promise = windowStage.createSubWindow("mySubWindow");
promise.then((data)=> { promise.then((data)=> {
windowClass = data; windowClass = data;
console.info('Succeeded in create sub window. Data: ' + JSON.stringify(data)); console.info('Succeeded in creating the subwindow. Data: ' + JSON.stringify(data));
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to create sub window. Cause: ' + JSON.stringify(err)); console.error('Failed to create the subwindow. Cause: ' + JSON.stringify(err));
}) })
} }
} }
...@@ -2682,11 +2682,11 @@ class myAbility extends Ability { ...@@ -2682,11 +2682,11 @@ class myAbility extends Ability {
var windowClass = null; var windowClass = null;
windowStage.getSubWindow((err, data) => { windowStage.getSubWindow((err, data) => {
if (err.code) { if (err.code) {
console.error('Failed to obtain the sub window. Cause: ' + JSON.stringify(err)); console.error('Failed to obtain the subwindow. Cause: ' + JSON.stringify(err));
return; return;
} }
windowClass = data; windowClass = data;
console.info('Succeeded in obtaining the sub window. Data: ' + JSON.stringify(data)); console.info('Succeeded in obtaining the subwindow. Data: ' + JSON.stringify(data));
}); });
} }
} }
...@@ -2718,9 +2718,9 @@ class myAbility extends Ability { ...@@ -2718,9 +2718,9 @@ class myAbility extends Ability {
let promise = windowStage.getSubWindow(); let promise = windowStage.getSubWindow();
promise.then((data)=> { promise.then((data)=> {
windowClass = data; windowClass = data;
console.info('Succeeded in obtaining the sub window. Data: ' + JSON.stringify(data)); console.info('Succeeded in obtaining the subwindow. Data: ' + JSON.stringify(data));
}).catch((err)=>{ }).catch((err)=>{
console.error('Failed to obtain the sub window. Cause: ' + JSON.stringify(err)); console.error('Failed to obtain the subwindow. Cause: ' + JSON.stringify(err));
}) })
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册