Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Aug 9, 2022
1 parent e2fbf4a commit f3a56dd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/widgets/AjaxControllerActionsWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ class AjaxControllerActionsWidget extends Widget
* @var
*/
public $modelId;
/**
* @var
*/
public $urlParams = [];
/**
* @var
*/
public $isRunFirstActionOnClick = false;

/**
* @throws Exception
Expand Down Expand Up @@ -101,9 +109,10 @@ public function run()

$this->options = ArrayHelper::merge($this->defaultOptions, [
'data' => [
'url' => Url::to(["/".$this->controllerId."/model-actions", 'pk' => $this->modelId]),
'url' => Url::to(ArrayHelper::merge(["/".$this->controllerId."/model-actions", 'pk' => $this->modelId], (array) $this->urlParams)),
'controller-id' => $this->controllerId,
'model-id' => $this->modelId,
'is-run-first-action-on-click' => (int)$this->isRunFirstActionOnClick,
],
], $this->options);

Expand Down
3 changes: 3 additions & 0 deletions src/widgets/assets/src/css/backend-filters.css
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@
.sx-backend-filters-form.form-inline .form-control {
width: 100%;
}
.sx-backend-filters-form.form-inline .form-control {
padding: 5px;
}
.sx-backend-filters-form.form-inline .dropdown-menu .filter--group--body {
margin: 20px 10px;
}
Expand Down
9 changes: 7 additions & 2 deletions src/widgets/assets/src/js/ajax-controller-actions-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@
$("body").on("click", '.sx-btn-ajax-actions', function(e) {
e.preventDefault();

$(this).addClass('sx-opened-actions');
if ($(this).data("is-run-first-action-on-click") == 1) {
$(this).trigger("firstAction");
} else {
$(this).trigger("contextmenu");
}
/*$(this).addClass('sx-opened-actions');
$('.popover').popover('hide');
Expand All @@ -92,7 +97,7 @@
} else {
var data = _.clone($(this).data());
self._createPopover($(this), data);
}
}*/
});

//Скрыть лишние окошки
Expand Down

0 comments on commit f3a56dd

Please sign in to comment.