Файл: style/themes/web/Sidebar_PC.js
Строк: 82
<?php
var Sidebar = {
toggle: function(event){
event.preventDefault();
var sidebar_wrap = document.getElementById("sidebar_wrap")
if (sidebar_wrap.style.width == "218px"){
Sidebar.openFunction("left");
}else{
Sidebar.openFunction("right");
}
},
toggleSwipe: function(direction){
if (direction == 'right'){
Sidebar.openFunction("right");
}else{
Sidebar.openFunction("left");
}
},
openFunction: function(direction){
var sidebar_wrap = document.getElementById("sidebar_wrap"),
left_nav_bg = document.getElementById("left_nav_bg"),
content_wrap_move = document.getElementById("content_wrap_move"),
main_search_form = document.getElementById("main_search_form"),
main_search_input_ico = document.getElementById("main_search_input_ico");
if (direction == 'right'){
sidebar_wrap.style.width = "218px";
sidebar_wrap.style.height = "auto";
left_nav_bg.style.width = "218px";
content_wrap_move.style.marginRight = "-218px";
main_search_form.style.display = "block";
main_search_input_ico.style.display = "none";
Sidebar.addClass(document.body,"openSidebar");
}else{
sidebar_wrap.style.width = "";
sidebar_wrap.style.height = "";
left_nav_bg.style.width = "";
content_wrap_move.style.marginRight = "0";
main_search_form.style.display = "none";
main_search_input_ico.style.display = "block";
Sidebar.removeClass(document.body,"openSidebar");
}
},
addClass: function(o, c){
var re = new RegExp("(^|\s)" + c + "(\s|$)", "g")
if (re.test(o.className)) return
o.className = (o.className + " " + c).replace(/s+/g, " ").replace(/(^ | $)/g, "")
},
removeClass: function(o, c){
var re = new RegExp("(^|\s)" + c + "(\s|$)", "g")
o.className = o.className.replace(re, "$1").replace(/s+/g, " ").replace(/(^ | $)/g, "")
}
}
?>