Skip to content

Commit

Permalink
Fixed enqueing head html
Browse files Browse the repository at this point in the history
  • Loading branch information
Mosnar committed Sep 13, 2018
1 parent bf0b134 commit 839cb50
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ Craft.BulkEditModal = Garnish.Modal.extend(
this.loaded = true;
this.$container.append(response.modalHtml);
Craft.initUiElements(this.$container);
Craft.appendHeadHtml(response.headHtml);
Craft.appendFootHtml(response.footHtml);

this._unbindEventHandlersForFieldSelect();
this._bindEventHandlersForFieldEditor();
} else {
Expand Down
19 changes: 13 additions & 6 deletions src/controllers/BulkEditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,18 @@ public function actionGetFields(): Response
'site' => $site
]);

return $this->asJson([
$responseData = [
'success' => true,
'modalHtml' => $modalHtml,
'requestId' => $requestId,
'elementIds' => $elementIds,
'siteId' => $site->id
]);
];
$responseData['headHtml'] = $view->getHeadHtml();
$responseData['footHtml'] = $view->getBodyHtml();


return $this->asJson($responseData);
}

public function actionGetEditScreen(): Response {
Expand Down Expand Up @@ -126,7 +131,6 @@ public function actionGetEditScreen(): Response {
} catch (\Exception $e) {
throw $e;
}
// $transaction->commit();

$baseEntry = null;
$view = \Craft::$app->getView();
Expand All @@ -137,13 +141,16 @@ public function actionGetEditScreen(): Response {
'baseElement' => $baseEntry,
'site' => $site
]);

return $this->asJson([
$responseData = [
'success' => true,
'modalHtml' => $modalHtml,
'requestId' => $requestId,
'siteId' => $site->id
]);
];
$responseData['headHtml'] = $view->getHeadHtml();
$responseData['footHtml'] = $view->getBodyHtml();

return $this->asJson($responseData);

}

Expand Down

0 comments on commit 839cb50

Please sign in to comment.