From 32b8332a168642a2797ee8f0e45ddcdc8f1392a2 Mon Sep 17 00:00:00 2001 From: ahamed07sajeeb Date: Wed, 11 Dec 2019 15:01:29 +0600 Subject: [PATCH] Fixed issue #150, menu item selection problem at create new article view --- .../components/com_menus/Field/MenutypeField.php | 3 ++- administrator/components/com_menus/tmpl/item/edit.php | 2 +- build/media_source/com_menus/js/admin-item-edit.es6.js | 9 +++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/administrator/components/com_menus/Field/MenutypeField.php b/administrator/components/com_menus/Field/MenutypeField.php index 034a3d56d39..435474423b3 100644 --- a/administrator/components/com_menus/Field/MenutypeField.php +++ b/administrator/components/com_menus/Field/MenutypeField.php @@ -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'); @@ -143,6 +143,7 @@ protected function getInput() $html[] = ''; + $html[] = ''; diff --git a/administrator/components/com_menus/tmpl/item/edit.php b/administrator/components/com_menus/tmpl/item/edit.php index 1987910c62c..e5a008529ef 100644 --- a/administrator/components/com_menus/tmpl/item/edit.php +++ b/administrator/components/com_menus/tmpl/item/edit.php @@ -179,7 +179,7 @@ } echo LayoutHelper::render('joomla.edit.global', $this); - + ?> diff --git a/build/media_source/com_menus/js/admin-item-edit.es6.js b/build/media_source/com_menus/js/admin-item-edit.es6.js index da45e9fe93d..d9d6fd8829d 100644 --- a/build/media_source/com_menus/js/admin-item-edit.es6.js +++ b/build/media_source/com_menus/js/admin-item-edit.es6.js @@ -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') {