? Error

User tests: Successful: Unsuccessful:

avatar ecsspert
ecsspert
19 Nov 2013

In the media/jui/js/treeselectmenu.jquery.js file I notice some inefficient silly jQuery selectors:

94: $(this).parent().parent().parent().parent().parent().parent().find('ul.treeselect-sub input').attr('checked', 'checked');
98: $(this).parent().parent().parent().parent().parent().parent().find('ul.treeselect-sub input').attr('checked', false);
104: $parent = $(this).parent().parent().parent().parent().parent().parent().parent();
111: $parent = $(this).parent().parent().parent().parent().parent().parent().parent();

The sollution would be to replace this with .parents().eq() so the resulting code would be

Please instruct me if I'm not doing the pull request correctly since I would really love to contribute in improving this code.

avatar ecsspert ecsspert - open - 19 Nov 2013
avatar brunobatista
brunobatista - comment - 19 Nov 2013

:+1:

avatar wilsonge
wilsonge - comment - 21 Nov 2013

Thank you - this PR is great! We now need two independent testers on the tracker (http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32762&start=0) and then we can merge this!

Thanks again!

avatar KISS-Web-Design
KISS-Web-Design - comment - 21 Nov 2013

Happy to test this if there are some testing requirements / instructions / etc.

avatar wilsonge
wilsonge - comment - 21 Nov 2013

This js helps with the 'tree' we use for the menu assignment in the backend of each module.

avatar KISS-Web-Design
KISS-Web-Design - comment - 21 Nov 2013

OK, thanks. I thought that was the purpose but as the code is not in the administrator path I wasn't sure.

avatar wilsonge
wilsonge - comment - 21 Nov 2013

There shouldn't be any media in the administrator path! But no worries :) Happy testing!

avatar KISS-Web-Design
KISS-Web-Design - comment - 22 Nov 2013

Hi,

This PR needs to include the treeselectmenu.jquery.min.js as well as the normal version.

The min version is loaded when a site is NOT in debug mode, and that file has not changed, this PR can be tested by placing the test site in debug mode - and that seems to perform fine.

I tested current functionality (before PR applied) by:

  • navigated to the module manager,
  • select any module,
  • select the menu assignment tab,
  • select "Only on the pages selected" from the dropdown
  • select the down arrow next to any menu
  • Select "deselect all" from the dropdown
  • Select "- Collapse" from the bottom of the dropdown

I tested the uncompressed changed file from this PR by putting the site into debug mode and repeating the above steps.

In addition, using the inspector, I placed breakpoints at each of the changed lines and repeated the above steps - ensuring that the process halted on the changed code, then clicking run to continue.

All that is needed now is the compressed (minified) js file to be added and tested.

Chris.

avatar ecsspert
ecsspert - comment - 22 Nov 2013

Can someone please advise me on how to create the minified version?

Thank you,

Vlad

On Friday, November 22, 2013, Chris Jones-Gill wrote:

Hi,

This PR needs to include the treeselectmenu.jquery.min.js as well as the
normal version.

The min version is loaded when a site is NOT in debug mode, and that file
has not changed, this PR can be tested by placing the test site in debug
mode - and that seems to perform fine.

I tested current functionality (before PR applied) by:

  • navigated to the module manager,
  • select any module,
  • select the menu assignment tab,
  • select "Only on the pages selected" from the dropdown
  • select the down arrow next to any menu
  • Select "deselect all" from the dropdown
  • Select "- Collapse" from the bottom of the dropdown

I tested the uncompressed changed file from this PR by putting the site
into debug mode and repeating the above steps.

In addition, using the inspector, I placed breakpoints at each of the
changed lines and repeated the above steps - ensuring that the process
halted on the changed code, then clicking run to continue.

All that is needed now is the compressed (minified) js file to be added
and tested.

Chris.


Reply to this email directly or view it on GitHub#2564 (comment)
.

Vlad Zinculescu
UX Developer
http://vlad.zinculescu.com

avatar KISS-Web-Design
KISS-Web-Design - comment - 23 Nov 2013

I use UglifyJS, but if you don't want to install it locally there is a free online tool called jscompress that you can use.

Chris.

avatar ecsspert
ecsspert - comment - 23 Nov 2013

Thanks @KISS-Web-Design for your suggestion. I used jscompress since I see it's built on UglifyJS, though I think it's a good idea to try the real thing in the future.

avatar roland-d roland-d - reference | - 14 Jul 14
avatar roland-d
roland-d - comment - 14 Jul 2014

I have created a new PR #3902 as the current one is no longer applicable. This one can be closed.

avatar Bakual
Bakual - comment - 14 Jul 2014

Closing in favor of #3902

avatar Bakual Bakual - change - 14 Jul 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-07-14 19:12:35
avatar Bakual Bakual - close - 14 Jul 2014

Add a Comment

Login with GitHub to post a comment