191 lines
6.1 KiB
JavaScript
191 lines
6.1 KiB
JavaScript
jQuery(document).ready(function($) {
|
|
|
|
$('.accordion-group .active span').removeClass('icon-caret-right').addClass('icon-caret-down');
|
|
$('.accordion-group').on('show', function (e) {
|
|
$(e.target).prev('.accordion-heading').find('.accordion-toggle').addClass('active');
|
|
$('.accordion-group .active span').removeClass('icon-caret-right').addClass('icon-caret-down');
|
|
});
|
|
$('.accordion-group').on('hide', function (e) {
|
|
$('.accordion-group .active span').removeClass('icon-caret-down').addClass('icon-caret-right');
|
|
$(this).find('.accordion-toggle').not($(e.target)).removeClass('active');
|
|
|
|
});
|
|
|
|
//Add slashes in root menu in the header
|
|
$('#root-nav li').after('<li>/</li>');
|
|
$('#root-nav li:last-child').remove();
|
|
|
|
//Show-hide search box
|
|
$('#search-container').hide();
|
|
$(document).on('click', '#search-btn', function(){
|
|
$('#search-container').slideToggle();
|
|
});
|
|
|
|
//fix easydnnnews edit link
|
|
$('.news a.edit').each(function () {
|
|
var nextElem = $(this).next();
|
|
$('<i class="icon-pencil"> </i> ').prependTo(this)
|
|
$(this).appendTo(nextElem);
|
|
});
|
|
|
|
//trim categories
|
|
$('.edn-categories').each(function () {
|
|
|
|
var s = $(this).text();
|
|
var n = s.indexOf(',');
|
|
s = s.substring(0, n != -1 ? n : s.length);
|
|
switch (s) {
|
|
case 'CaseStudies':
|
|
s = "Case Studies";
|
|
break
|
|
case "PressReleases":
|
|
s = "Press Releases";
|
|
break
|
|
case "WhitePapers":
|
|
s = "White Papers";
|
|
break
|
|
}
|
|
|
|
$(this).text(s);
|
|
});
|
|
|
|
//search button
|
|
$('#dnn_Header_dnnSEARCH_txtSearch').addClass('pull-left');
|
|
$('#dnn_Header_dnnSEARCH_cmdSearch').addClass('btn').addClass('pull-left');
|
|
|
|
//Show-hide services menu
|
|
$('#services-menu-container').hide();
|
|
var serviceMenuActive = false;
|
|
|
|
$('#services-menu-container').mouseenter(function(){
|
|
serviceMenuActive = true;
|
|
}).mouseleave(function(){
|
|
serviceMenuActive = false;
|
|
$('#services-menu-container').hide();
|
|
});
|
|
|
|
//blog search default text
|
|
var placeholder = 'Search Blog';
|
|
|
|
$('.blog-search').each(function () {
|
|
$(this).on({
|
|
focus: function () {
|
|
if ($(this).val() == placeholder) $(this).val('');
|
|
},
|
|
blur: function () {
|
|
if ($(this).val() == '') $(this).val(placeholder);
|
|
}
|
|
});
|
|
if ($(this).val() == '') $(this).val(placeholder);
|
|
});
|
|
|
|
$('#primary-nav .our-services-page').mouseenter(function(){
|
|
$('#services-menu-container').show();
|
|
}).mouseleave(function(){
|
|
|
|
setTimeout(function () {
|
|
if(serviceMenuActive === false){
|
|
$('#services-menu-container').hide();
|
|
}
|
|
}, 100);
|
|
});
|
|
|
|
//blog post page, make all boxes the same height
|
|
var maxHeight = 0;
|
|
$('.blog-home-post, .news-events-post, .white-note').not('.nosize').css('height', 'auto').each(function () {
|
|
maxHeight = Math.max(maxHeight, $(this).outerHeight(false));
|
|
}).height(maxHeight);
|
|
|
|
//move blog comments under post details div
|
|
$('.comments-section').appendTo('.post-detail');
|
|
|
|
//Partners
|
|
if ($('.partners-container').length) {
|
|
$('.partners-container li').on({
|
|
|
|
click: function () {
|
|
if ($(this).parent().parent("[class!='certifications']")) {
|
|
|
|
var partnerLink = $(this).find('a.partner-link').attr('href');
|
|
if (!$(this).closest('ul').hasClass('case-studies-list')) {
|
|
window.open(partnerLink, '_blank');
|
|
}
|
|
else {
|
|
window.open(partnerLink, '_self');
|
|
}
|
|
}
|
|
else {
|
|
return false;
|
|
}
|
|
|
|
},
|
|
mouseenter: function () {
|
|
var partnerTitle = $(this).find('img').attr('title');
|
|
var partnerDesc = $(this).find('img').attr('alt');
|
|
$(this).append('<div class="partner-info"><div class="partner-info-content"><h4>' + partnerTitle + '</h4><p class="partner-desc">' + partnerDesc + '</p></div></div>');
|
|
$(this).find('.partner-info').hide().fadeIn(500);
|
|
},
|
|
mouseleave: function () {
|
|
$(this).find('.partner-info').remove();
|
|
}
|
|
});
|
|
}
|
|
$('.certifications li').unbind('click');
|
|
|
|
if ($("#ControlBar_EditPage:contains('Mode')").length > 0) {
|
|
$('.partner-edit').show();
|
|
}
|
|
else {
|
|
$('.partner-edit').hide();
|
|
}
|
|
|
|
//Multirow - Hide unused rows (after the first), unless your editing
|
|
$('.multirow .box-row').not(':first').not(':last').each(function () {
|
|
if (($(this).find('.DNNEmptyPane').length > 1) && (!($("#ControlBar_EditPage:contains('Mode')").length > 0))) {
|
|
$(this).hide();
|
|
}
|
|
|
|
});
|
|
|
|
//White Note
|
|
|
|
$('.white-note:not(.tools), .news-events-post:not(.tools)').on({
|
|
click: function () {
|
|
var linky = $(this).find('h3 a').attr('href');
|
|
window.open(linky, '_self');
|
|
},
|
|
});
|
|
|
|
$('.white-note:not(.tools), .presentations').on({
|
|
click: function () {
|
|
var curr = window.location.href;
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
var linky = $(this).find('h3 a').attr('href');
|
|
|
|
window.open(linky, "_blank");
|
|
location.href = curr;
|
|
return false;
|
|
},
|
|
});
|
|
|
|
|
|
|
|
//Contact
|
|
if ($('#map').length) {
|
|
$(document).on('click', '#map-overlay-content .close', function () {
|
|
$('#map-overlay').fadeOut();
|
|
});
|
|
}
|
|
|
|
//Hide Tert menu if no items
|
|
if ($('.tertiary .subnav ul li').length >= 1) {
|
|
$('.subnav').show();
|
|
}
|
|
else {
|
|
$('.subnav').hide();
|
|
}
|
|
|
|
//Default select option for contact forms
|
|
$('select.mail-signup option[value="Yes"]').attr("selected",true);
|
|
}); |