Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select a range of agents by shift-clicking checkboxes #1808

Merged
merged 3 commits into from Jan 21, 2016

Conversation

Projects
None yet
7 participants
@grahamc
Copy link
Contributor

commented Jan 15, 2016

screencast-uywrw

  1. If you tick or untick a checkbox, then press shift while checking
    a different checkbox, all the agents between the two will be ticked
    or unticked to match the previous tick.
  2. I tried to use jQuery().click... but the handlers would eventually
    be removed from the elements, forcing me to use live, which may
    not be ideal.
  3. A small improvement in the check-all/none code.

grahamc added some commits Jan 15, 2016

Select a range of agents via shift-clicking checkboxes
1. If you tick or untick a checkbox, then press shift while checking
   a different checkbox, all the agents between the two will be ticked
   or unticked to match the previous tick.
2. I tried to use `jQuery().click...` but the handlers would eventually
   be removed from the elements, forcing me to use `live`, which may
   not be ideal.
jQuery(document).ready(function() {
jQuery('.agent_select').live('click', function(e) {
if (!this.checked) {

This comment has been minimized.

Copy link
@zabil

zabil Jan 16, 2016

Contributor

Use of .live is deprecated on 1.7 have you tried this with on?
http://api.jquery.com/live/

This comment has been minimized.

Copy link
@ketan

ketan Jan 16, 2016

Member

It'll have to be written as

jquery('container-elem').on('click', '.agent_select', handler)

This comment has been minimized.

Copy link
@zabil

zabil Jan 16, 2016

Contributor

The problem with live is it checks your dom for current and future elements which ends up making this script slow.
Should take this for a spin with a lot more agents.

@ketan ketan added this to the Release 16.2 milestone Jan 18, 2016

@ketan

This comment has been minimized.

Copy link
Member

commented Jan 18, 2016

@rajiesh - can you quickly QA this PR. It seems to be OK from a quick check I performed.

@grahamc

This comment has been minimized.

Copy link
Contributor Author

commented Jan 21, 2016

@ketan Updated to use .on() instead. Note I seem to have to target #body_content otherwise when the table refreshes, the javascript no longer works.

@zabil Does the current state seem like it'll be bad on lots of agents? I can't test that easily, myself.

zabil added a commit that referenced this pull request Jan 21, 2016

Merge pull request #1808 from grahamc/range-select-agents
Select a range of agents via shift-clicking checkboxes

@zabil zabil merged commit 2df6539 into gocd:master Jan 21, 2016

@grahamc grahamc deleted the grahamc:range-select-agents branch Jan 21, 2016

@rajiesh

This comment has been minimized.

Copy link
Contributor

commented Jan 21, 2016

verified it on 16.2.0-2867(2df6539) - works as expected

@ketan ketan changed the title Select a range of agents via shift-clicking checkboxes Select a range of agents by shift-clicking checkboxes Feb 11, 2016

@JorritSalverda

This comment has been minimized.

Copy link

commented Feb 16, 2016

For disabling and deleting agents it only does that for the first and last clicked agent, not the ones in between although they're shown as selected. Running Chrome Version 48.0.2564.109 m on Windows 7.

I have shift pressed for both the first and last item, although I might release shift in between.

@alexouzounis

This comment has been minimized.

Copy link

commented Feb 16, 2016

same issue with @JorritSalverda here, using Chrome Version 48.0.2564.97 (64-bit) on OSX 10.11.3 (15D21)

@rajiesh

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2016

Could reproduce this issue on 16.2.0, it happens when user makes the selection and clicks on the action(enable/disable/delete) immediately. If there is a delay of, say 5 secs, between the selection and the action the action applies to all the agents selected. Need to investigate

@JorritSalverda

This comment has been minimized.

Copy link

commented Feb 18, 2016

That wait a couple of seconds trick seems to work for disabling agents, but not so much for deleting agents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.