User tests: Successful: Unsuccessful:
Replaces #24335
Thanks @bahl24
Creates an es6.js file in the build/media_source/com_templates/
Patch.
Run npm
Edit Cassiopea template style
Template(Styles) -> Menu Assignment -> 'Toggle Selection' buttons
There may be another way to format the es6.js. Please comment before merge.
@C-Lodder
@dgrammatiko
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_templates JavaScript Repository NPM Change |
Labels |
Added:
NPM Resource Changed
?
|
@infograf768 couple things here:
toggleAll()
you need to do Joomla.toggleAll()
)() => { /** your code here */ }();
eg:
/**
* @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 = window.Joomla || {};
(Joomla => {
Joomla.toggleAll = () => {
const checkBoxes = [].slice.call(document.querySelectorAll('.chk-menulink'));
const value = checkBoxes[0].checked;
checkBoxes.forEach((checkBox) => {
checkBox.checked = !value;
});
};
Joomla.toggleMenutype = (a) => {
const checkBox = [].slice.call(document.getElementsByClassName(a));
const value = checkBox[0].checked;
checkBox.forEach((element) => {
element.checked = !value;
});
};
})(Joomla);
Tks, testing now
Would be nice to use hound on localhost
@infograf768 It is called Code Sniffer. See https://docs.joomla.org/Joomla_CodeSniffer
@infograf768 you can use the lint command eg npx eslint .
or npm run lint:js
Bonus you can run npx eslint . --fix
to autofix the CS
I have tested this item
I have not tested this item.
I have not tested this item.
@richard67
Should be OK now.
I have tested this item
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-06-10 23:01:36 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
Thanks!
I guess I need help to solve hound :
is defined but never used no-unused-vars
...