Skip to content

Commit

Permalink
[com_menus] Hide move/copy in admin menu batch modal (#18216)
Browse files Browse the repository at this point in the history
* [com_menus] Hide options until an Administrator menu/parent item is selected in Batch mode

PR for #15133

### Steps to reproduce the issue
Create an Administrator menu.
Create a menu item under this Administrator menu.
Click this menu item.
Click `Batch` button.

### Expected result
Copy/Move radios to display only after a menu/parent item is selected.

### Actual result
![batchmenu](https://cloud.githubusercontent.com/assets/368084/24759500/845c17e2-1a9a-11e7-95af-26cc18793cd7.jpg)

* codestyle

* coding style (#64)
  • Loading branch information
brianteeman authored and Michael Babker committed Oct 5, 2017
1 parent f2e3ef0 commit 2b7c3e9
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@
$published = $this->state->get('filter.published');
$clientId = $this->state->get('filter.client_id');
$menuType = JFactory::getApplication()->getUserState('com_menus.items.menutype');
if ($clientId == 1) :
JFactory::getDocument()->addScriptDeclaration(
'
jQuery(document).ready(function($){
if ($("#batch-menu-id").length){var batchSelector = $("#batch-menu-id");}
if ($("#batch-copy-move").length) {
$("#batch-copy-move").hide();
batchSelector.on("change", function(){
if (batchSelector.val() != 0 || batchSelector.val() != "") {
$("#batch-copy-move").show();
} else {
$("#batch-copy-move").hide();
}
});
}
});
'
);
endif;

?>
<div class="container-fluid">
<?php if (strlen($menuType) && $menuType != '*') : ?>
Expand Down

0 comments on commit 2b7c3e9

Please sign in to comment.