Commit 03a2a05f authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

[effects/dialogparent] Fix strict mode issues

Summary:
Modification of undeclared variables is illegal in the strict mode, e.g.

```lang=js
mainWindows = window.mainWindows();
```

is illegal.

Test Plan: The Dialog Parent effect works with both QScriptEngine and QJSEngine.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15413
parent 617b4d92
......@@ -23,7 +23,6 @@ var dialogParentEffect = {
duration: animationTime(300),
windowAdded: function (window) {
"use strict";
var mainWindows, i, w;
if (window === null || window.modal === false) {
return;
}
......@@ -31,9 +30,9 @@ var dialogParentEffect = {
},
dialogGotModality: function (window) {
"use strict";
mainWindows = window.mainWindows();
for (i = 0; i < mainWindows.length; i += 1) {
w = mainWindows[i];
var mainWindows = window.mainWindows();
for (var i = 0; i < mainWindows.length; i += 1) {
var w = mainWindows[i];
if (w.dialogParentAnimation !== undefined) {
continue;
}
......@@ -59,7 +58,6 @@ var dialogParentEffect = {
},
windowClosed: function (window) {
"use strict";
var mainWindows, i, w;
dialogParentEffect.cancelAnimation(window);
if (window.modal === false) {
return;
......@@ -68,9 +66,9 @@ var dialogParentEffect = {
},
dialogLostModality: function (window) {
"use strict";
mainWindows = window.mainWindows();
for (i = 0; i < mainWindows.length; i += 1) {
w = mainWindows[i];
var mainWindows = window.mainWindows();
for (var i = 0; i < mainWindows.length; i += 1) {
var w = mainWindows[i];
if (w.dialogParentAnimation === undefined) {
continue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment