Commit 68667160 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Kickoff / Kicker] Request closing plasmoid properly

In 0d6792c4 I turned the JS into a singleton but overlooked that it also accesses plasmoid context property.
Instead of randomly calling outside objects from this library function,
signal what the caller should do.
The function already returned undefined for doing nothing,and true for requesting a close.
Changed all call sites of this function to explicitly check for true

Differential Revision: https://phabricator.kde.org/D10915
parent 22a3c342
......@@ -164,8 +164,6 @@ function triggerAction(model, index, actionId, actionArgument) {
var closeRequested = model.trigger(index, actionId, actionArgument);
if (closeRequested) {
plasmoid.expanded = false;
return true;
}
......
......@@ -911,7 +911,9 @@ Kicker.DashboardWindow {
}
onActionTriggered: {
Tools.triggerAction(ListView.view.model, model.index, actionId, actionArgument);
if (Tools.triggerAction(ListView.view.model, model.index, actionId, actionArgument) === true) {
plasmoid.expanded = false;
}
}
function openActionMenu(visualParent, x, y) {
......
......@@ -51,7 +51,7 @@ Item {
}
function actionTriggered(actionId, actionArgument) {
var close = Tools.triggerAction(GridView.view.model, model.index, actionId, actionArgument);
var close = (Tools.triggerAction(GridView.view.model, model.index, actionId, actionArgument) === true);
if (close) {
root.toggle();
......
......@@ -57,7 +57,9 @@ Item {
}
onActionTriggered: {
Tools.triggerAction(ListView.view.model, model.index, actionId, actionArgument);
if (Tools.triggerAction(ListView.view.model, model.index, actionId, actionArgument) === true) {
plasmoid.expanded = false;
}
}
function openActionMenu(visualParent, x, y) {
......
......@@ -43,7 +43,9 @@ Item {
}
onActionTriggered: {
Tools.triggerAction(repeater.model, model.index, actionId, actionArgument);
if (Tools.triggerAction(repeater.model, model.index, actionId, actionArgument) === true) {
plasmoid.expanded = false;
}
}
function openActionMenu(visualParent, x, y) {
......
......@@ -164,8 +164,6 @@ function triggerAction(model, index, actionId, actionArgument) {
var closeRequested = model.trigger(index, actionId, actionArgument);
if (closeRequested) {
plasmoid.expanded = false;
return true;
}
......
......@@ -53,7 +53,9 @@ Item {
}
onActionTriggered: {
Tools.triggerAction(ListView.view.model, model.index, actionId, actionArgument);
if (Tools.triggerAction(ListView.view.model, model.index, actionId, actionArgument) === true) {
plasmoid.expanded = false;
}
if (actionId.indexOf("_kicker_favorite_") === 0) {
switchToInitial();
......
Supports Markdown
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