Skip to content

Instantly share code, notes, and snippets.

@camd
Last active August 29, 2015 14:13
Show Gist options
  • Save camd/8a08b8fa23d74dfb006a to your computer and use it in GitHub Desktop.
Save camd/8a08b8fa23d74dfb006a to your computer and use it in GitHub Desktop.
forward
$rootScope.$on(thEvents.selectNextJob, function(ev){
var jobMap = ThResultSetModel.getJobMap($rootScope.repoName);
var el, key, job;
var jobs = $(".th-view-content .job-btn");
var idx = jobs.index(jobs.filter(".selected-job"));
idx = idx+1 > _.size(jobs)? 0: idx+1;
el = $(jobs[idx]);
while (el.css('display') === "none") {
idx = idx+1 > _.size(jobs)? 0: idx+1;
el = $(jobs[idx]);
}
key = el.attr(jobKeyAttr);
job = jobMap[key].job_obj;
selectJob(job);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment