Skip to content
Permalink
Browse files
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 eee3dba3e6518b553ae8e77dc41eeff8d27dca9c
Showing with 14 additions and 1 deletion.
  1. +14 −1 war/src/main/js/pluginSetupWizardGui.js
@@ -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');
@@ -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 = {};

0 comments on commit eee3dba

Please sign in to comment.