Skip to content

Commit

Permalink
remove it
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed Oct 13, 2019
1 parent ed320b0 commit b20e7bb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,7 @@
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));

$this->document->addScriptDeclaration('
Joomla.submitbutton = function(task)
{
if (task == "actionlogs.exportLogs")
{
Joomla.submitform(task, document.getElementById("exportForm"));
return;
}
if (task == "actionlogs.exportSelectedLogs")
{
// Get id of selected action logs item and pass it to export form hidden input
var cids = [];
jQuery("input[name=\'cid[]\']:checked").each(function() {
cids.push(jQuery(this).val());
});
document.exportForm.cids.value = cids.join(",");
Joomla.submitform(task, document.getElementById("exportForm"));
return;
}
Joomla.submitform(task);
};
');
HTMLHelper::_('script', 'com_actiologs/admin-actionlogs-default.js', ['relative' => true, 'version' => 'auto']);
?>

<form action="<?php echo Route::_('index.php?option=com_actionlogs&view=actionlogs'); ?>" method="post" name="adminForm" id="adminForm">
Expand Down
30 changes: 30 additions & 0 deletions build/media_source/com_actiologs/js/admin-actionlogs-default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Joomla.submitbutton = function(task) {
if (task === "actionlogs.exportLogs") {
Joomla.submitform(task, document.getElementById("exportForm"));

return;
}

if (task === "actionlogs.exportSelectedLogs") {
// Get id of selected action logs item and pass it to export form hidden input
const cids = [];
const elements = [].slice.call(document.querySelectorAll("input[name='cid[]']:checked"));

if (elements.length) {
elements.forEach((element) => {
cids.push(element.value);
})
}

document.exportForm.cids.value = cids.join(",");
Joomla.submitform(task, document.getElementById("exportForm"));

return;
}

Joomla.submitform(task);
};

0 comments on commit b20e7bb

Please sign in to comment.