update
@@ -68,14 +68,13 @@ abstract class Action implements Renderable
/**
* Action constructor.
*
- * @param mixed $key
* @param string $title
*/
- public function __construct($key = null, $title = null)
+ public function __construct($title = null)
{
- $this->setKey($key);
-
- $this->title = $title;
+ if ($title) {
+ $this->title = $title;
+ }
}
@@ -156,7 +156,7 @@ JS;
protected function resolverScript()
return <<<JS
-function (data, target) {
+function (data) {
var response = data[0],
target = data[1];
@@ -178,6 +178,11 @@ function (data, target) {
case 'location':
window.location = then.value;
break;
+ case 'script':
+ (function () {
+ eval(then.value);
+ })();
+ break;
};