cloud-8.x-2.0-beta1/modules/cloud_service_providers/aws_cloud/js/aws_cloud_instance_type_prices.js
modules/cloud_service_providers/aws_cloud/js/aws_cloud_instance_type_prices.js
(function ($) {
'use strict';
if (!window.location.hash) {
return;
}
var instance_type = window.location.hash.substr(1);
var instance_type_underscore = instance_type.replace('.', '_');
// Find the column with instance type.
var $td = $('tr.' + instance_type_underscore + ' td:first');
if (!$td.html()) {
return;
}
// Highlight the row.
$('tr.' + instance_type_underscore).addClass('highlight');
// Calculate position.
var navbar_top = $('header').offset().top;
var header_height = $('table.aws_cloud_instance_type_prices thead').height();
var top = $td.offset().top - header_height - navbar_top;
setTimeout(function() {
$(window).scrollTop(top);
}, 500);
})(jQuery);
