Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2292 from kzantow/JENKINS-33948-scrollspy-clicks
[JENKINS-33948] - Always display clicked scrollspy items as active
  • Loading branch information
daniel-beck committed May 1, 2016
2 parents 3ac7ee9 + f046308 commit eee3dba
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion war/src/main/js/pluginSetupWizardGui.js
Expand Up @@ -104,7 +104,7 @@ var createPluginSetupWizard = function(appendTarget) {
return options.fn();
}
});

// Include handlebars templates here - explicitly require them and they'll be available by hbsfy as part of the bundle process
var errorPanel = require('./templates/errorPanel.hbs');
var loadingPanel = require('./templates/loadingPanel.hbs');
Expand Down Expand Up @@ -166,6 +166,19 @@ var createPluginSetupWizard = function(appendTarget) {
title: text
}).tooltip('show');
});

// handle clicking links that might not get highlighted due to position on the page
$wizard.on('click', '.nav>li>a', function(){
var $li = $(this).parent();
var activateClicked = function() {
if(!$li.is('.active')) {
$li.parent().find('>li').removeClass('active');
$li.addClass('active');
}
};
setTimeout(activateClicked, 150); // this is the scroll time
setTimeout(activateClicked, 250); // this should combat timing issues
});

// localized messages
var translations = {};
Expand Down

0 comments on commit eee3dba

Please sign in to comment.