Skip to content

Commit

Permalink
Fixed issue joomla-projects#150, menu item selection problem at creat…
Browse files Browse the repository at this point in the history
…e new article view
  • Loading branch information
ahamed committed Dec 11, 2019
1 parent f7da1dc commit 32b8332
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion administrator/components/com_menus/Field/MenutypeField.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class MenutypeField extends ListField
protected function getInput()
{
HTMLHelper::_('webcomponent', 'system/joomla-dropdown.min.js', array('version' => 'auto', 'relative' => true));
HTMLHelper::_('script', 'com_menus/admin-item-modal.js', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('script', 'com_menus/admin-item-edit.js', ['version' => 'auto', 'relative' => true]);

$html = array();
$recordId = (int) $this->form->getValue('id');
Expand Down Expand Up @@ -143,6 +143,7 @@ protected function getInput()

$html[] = '<input type="hidden" ' . $required . ' readonly="readonly" id="' . $this->id
. '" value="' . $value . '"' . $size . $class . '>';

$html[] = '<input type="hidden" name="' . $this->name . '" value="'
. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" id="' . $this->id . '_val">';

Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_menus/tmpl/item/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
}

echo LayoutHelper::render('joomla.edit.global', $this);

?>
</section>

Expand Down
9 changes: 9 additions & 0 deletions build/media_source/com_menus/js/admin-item-edit.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
((Joomla) => {
'use strict';


Joomla.setMenuType = (type, tmpl) => {
if (tmpl !== '') {
Joomla.submitbutton('item.setType', type);
} else {
window.location = `index.php?option=com_menus&view=item&task=item.setType&layout=edit&type=${type}`;
}
};

Joomla.submitbutton = (task, type) => {
if (task === 'item.setType' || task === 'item.setMenuType') {
if (task === 'item.setType') {
Expand Down

0 comments on commit 32b8332

Please sign in to comment.