Skip to content

Commit

Permalink
[4.0] Include content history javascript in the modal view (joomla#32131
Browse files Browse the repository at this point in the history
)

* Include content history javascript in the modal view

* Variable typehint
  • Loading branch information
wilsonge authored Jan 24, 2021
1 parent 9f2fc00 commit 9b4d07c
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 23 deletions.
2 changes: 0 additions & 2 deletions administrator/components/com_banners/tmpl/banner/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_contenthistory');
$wa->useScript('keepalive')
->useScript('form.validate')
->useScript('com_contenthistory.admin-history-versions')
->useScript('com_banners.admin-banner-edit');

?>
Expand Down
4 changes: 1 addition & 3 deletions administrator/components/com_banners/tmpl/client/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_contenthistory');
$wa->useScript('keepalive')
->useScript('form.validate')
->useScript('com_contenthistory.admin-history-versions');
->useScript('form.validate');

?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_contenthistory');
$wa->useScript('keepalive')
->useScript('form.validate')
->useScript('com_contenthistory.admin-history-versions');
->useScript('form.validate');

$app = Factory::getApplication();
$input = $app->input;
Expand Down
4 changes: 1 addition & 3 deletions administrator/components/com_contact/tmpl/contact/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_contenthistory');
$wa->useScript('keepalive')
->useScript('form.validate')
->useScript('com_contenthistory.admin-history-versions');
->useScript('form.validate');

$app = Factory::getApplication();
$input = $app->input;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_contenthistory');
$wa->useScript('keepalive')
->useScript('form.validate')
->useScript('com_contenthistory.admin-history-versions');
->useScript('form.validate');

$app = Factory::getApplication();
$input = $app->input;
Expand Down
4 changes: 1 addition & 3 deletions administrator/components/com_tags/tmpl/tag/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_contenthistory');
$wa->useScript('keepalive')
->useScript('form.validate')
->useScript('com_contenthistory.admin-history-versions');
->useScript('form.validate');

// Fieldsets to not automatically render by /layouts/joomla/edit/params.php
$this->ignore_fieldsets = ['jmetadata'];
Expand Down
4 changes: 1 addition & 3 deletions administrator/components/com_users/tmpl/note/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_contenthistory');
$wa->useScript('keepalive')
->useScript('form.validate')
->useScript('com_contenthistory.admin-history-versions');
->useScript('form.validate');

?>
<form action="<?php echo Route::_('index.php?option=com_users&view=note&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="note-form" class="form-validate">
Expand Down
10 changes: 7 additions & 3 deletions layouts/joomla/toolbar/versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@
* @var string $title
*/

Factory::getDocument()->getWebAssetManager()
->useScript('core')
->useScript('webcomponent.toolbar-button');
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getDocument()->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_contenthistory');

$wa->useScript('core')
->useScript('webcomponent.toolbar-button')
->useScript('com_contenthistory.admin-history-versions');

echo HTMLHelper::_(
'bootstrap.renderModal',
Expand Down

0 comments on commit 9b4d07c

Please sign in to comment.