On post pages, Menu Bar Search box doesnt open when search icon is clicked. (it works on main page)
Drupal.behaviors.advocateTheme... is only running on the main page.
If that is by design, the code that sets the click event listeners can be set in a document ready block instead of Drupal.behaviors... See Working Code below. (just like the section above it setting the load resize scroll event handlers)
(I'm using chrome on win10x64)
At the end of the file, lines 1972-EOF (line numbers are from prettified version so may be inaccurate)
;;(function($) {
Drupal.behaviors.advocateTheme = {
attach: function(context, settings) {
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false;
$(".page-contact .tabs").append("<div class='contact-text-header'>You can leave a message using the contact form below. For all magazine subscription needs please use: <a href='subcontact' target='_blank' style='color: #980000;'>www.advocate.com/subcontact</a> </div>");
$('iframe[src*="youtube.com"], iframe[src*="player.vimeo.com"]').each(function() {
$(this).wrap('<div class="video-responsive"></div>');
});
$('.pager-current').wrapInner('<span></span>');
$('.searchBox').click(function(e) {
$(this).toggleClass('active');
e.stopPropagation();
});
$('.searchForm').click(function(e) {
$('.searchBox').addClass('locked');
e.stopPropagation();
});
$(document).click(function(e) {
$('.searchBox').removeClass('locked');
$('.searchBox').removeClass('active');
e.stopPropagation();
});
if (!isMobile) {
$('.magazines .beanMagazine').hover(function() {
$('.hoverBox').animate({
'right': '0px'
}, 'slow');
}, function() {
$('.hoverBox').animate({
'right': '129px'
}, 'slow');
});
}
}
};
}
)(jQuery);
;;
;;(function($) {
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false;
$(document).ready(function($) {
$(".page-contact .tabs").append("<div class='contact-text-header'>You can leave a message using the contact form below. For all magazine subscription needs please use: <a href='subcontact' target='_blank' style='color: #980000;'>www.advocate.com/subcontact</a> </div>");
$('iframe[src*="youtube.com"], iframe[src*="player.vimeo.com"]').each(function() {
$(this).wrap('<div class="video-responsive"></div>');
});
$('.pager-current').wrapInner('<span></span>');
$('.searchBox').click(function(e) {
$(this).toggleClass('active');
e.stopPropagation();
});
$('.searchForm').click(function(e) {
$('.searchBox').addClass('locked');
e.stopPropagation();
});
$(document).click(function(e) {
$('.searchBox').removeClass('locked');
$('.searchBox').removeClass('active');
e.stopPropagation();
});
if (!isMobile) {
$('.magazines .beanMagazine').hover(function() {
$('.hoverBox').animate({
'right': '0px'
}, 'slow');
}, function() {
$('.hoverBox').animate({
'right': '129px'
}, 'slow');
});
}
})
}
)(jQuery);
;;