99 lines
3.1 KiB
JavaScript
99 lines
3.1 KiB
JavaScript
|
$(document).ready(function () {
|
||
|
/* magnify icon for mobile and tablet */
|
||
|
$('a[rel=main-search]').click(function() {
|
||
|
var form = $('#main-search');
|
||
|
if (form.is(':visible')) {
|
||
|
form.slideUp();
|
||
|
}
|
||
|
else {
|
||
|
form.slideDown();
|
||
|
}
|
||
|
return false;
|
||
|
});
|
||
|
|
||
|
/* site main search: desktop*/
|
||
|
$('.search-widget select').change(function() {
|
||
|
var href = $(this).val();
|
||
|
var text = $(this).parent().find('option:selected').text();
|
||
|
var form = $('.search-widget form');
|
||
|
if (text.search(/advanced/i) != -1) {
|
||
|
window.location = href;
|
||
|
}
|
||
|
else if (text.search(/knowledge/i) != -1) {
|
||
|
form.attr('action', href);
|
||
|
form.find('.article_keyword').attr("name", "query").focus();
|
||
|
}
|
||
|
else {
|
||
|
form.find('.article_keyword').attr("name", "search_string").focus();
|
||
|
form.find('[name=search_forum]').val(href);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$('.social-sm .sprite-magnify').click(function() {
|
||
|
if ($(this).siblings('.main-search').find('form').is(':hidden')) {
|
||
|
$(this).siblings('.main-search').find('form').fadeIn().find('.txt').focus();
|
||
|
}
|
||
|
else {
|
||
|
$(this).siblings('.main-search').find('form').fadeOut();
|
||
|
}
|
||
|
return false;
|
||
|
})
|
||
|
|
||
|
/* menu icon */
|
||
|
$('.header .controller .sprite-menu').click(function() {
|
||
|
/* copy navbar menu */
|
||
|
if ($(this).siblings('.menu-b').find('.nav').length == 0) {
|
||
|
/* submenu */
|
||
|
$('.header .controller .navbar').html($('#menu').html()).find('.nav > li .expand').each(function() {
|
||
|
$(this).click(function() {
|
||
|
var id = $(this).siblings('a[rel]').attr('rel');
|
||
|
|
||
|
if ($(this).siblings('.subnav').is(':hidden')) {
|
||
|
$('.header .controller .navbar li.open').removeClass('open');
|
||
|
$('.header .controller .navbar .subnav').slideUp();
|
||
|
$(this).parent().addClass('open').find('.subnav').slideDown('fast');
|
||
|
}
|
||
|
else { $(this).parent().removeClass('open').find('.subnav').slideUp('fast'); }
|
||
|
|
||
|
return false;
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
|
||
|
if ($(this).hasClass('open')) {
|
||
|
$(this).siblings('.menu-b').slideUp('fast');
|
||
|
$(this).removeClass('open');
|
||
|
}
|
||
|
else {
|
||
|
$(this).siblings('.menu-b').slideDown('fast');
|
||
|
$(this).addClass('open');
|
||
|
}
|
||
|
return false;
|
||
|
});
|
||
|
|
||
|
$('.brand-b .user-profile .subnav').html($('#user_profile_menu').html());
|
||
|
|
||
|
/* subscribe form */
|
||
|
$('.utility .subscribe a').click(function() {
|
||
|
if ($(this).parent().hasClass('open')) {
|
||
|
$(this).siblings('.subscribe-form').slideUp();
|
||
|
$(this).parent().removeClass('open');
|
||
|
}
|
||
|
else {
|
||
|
$(this).siblings('.subscribe-form').slideDown();
|
||
|
$(this).parent().addClass('open');
|
||
|
}
|
||
|
return false;
|
||
|
});
|
||
|
|
||
|
/* dialog */
|
||
|
$('a.dialog-lnk[rel]').each(function() {
|
||
|
$(this).click(function() {
|
||
|
$('#' + $(this).attr('rel')).dialog({
|
||
|
modal: true
|
||
|
});
|
||
|
return false;
|
||
|
})
|
||
|
});
|
||
|
})
|