Перейти к публикации

Рекомендованные сообщения

Hello,
I am trying to install the "Xsort by sander" module on DLE 12.0
But there is a problem ....
Can not scroll fields
Surely a problem of the script:

 

<script>
function xsort_empty(){
	$("#dle-content").html('<div class="xsort_empty">Ничего не найдено</div>');
}

$(document)
.on('click','.xsort-selected',function(e){
	var ul = $(this).parents('.xsort-div').find('.xsort-ul');
	var d = ul.css('display');
	$('.xsort-ul').hide();
	if(d=='none') ul.slideDown(200);
//	var litop = ul.find('li.current')[0].offsetTop-31;
//	ul.animate({'scrollTop':litop+'px'},100);
	return false;
})
.on('click','.xsort-ul li',function(){
	$this = $(this);
	var text = $this.text();
	var val = $this.data('val');
	var field = $this.parents('.xsort-ul').data('field');
	var sel = $this.parents('.xsort-div');
	if(val!=='') sel.addClass('xsort-active');
	else sel.removeClass('xsort-active');
	sel = sel.find('.xsort-selected');
	var url = window.location.href;
	if(field=='defaultsort'){
		$this.siblings().removeClass('xasc xdesc');
		sel = sel.find('span');
		if(val!==''){
			if($this.hasClass('xdesc')){
				$this.removeClass('xdesc').addClass('xasc');
				sel.attr("class","xasc");
			}else{
				$this.removeClass('xasc').addClass('xdesc');
				sel.attr("class","xdesc");
			}
		}else{
			sel.removeClass('xasc xdesc');
		}
	}else{
		if($(this).hasClass('current')){
			$this.parents('.xsort-ul').find('li').eq(0).click();
			return false;
		}
	}
	sel.html(text);
	$this.addClass('current').siblings().removeClass('current');

	if(url.indexOf('/page/')>=0){
		url = url.split('/page/');
		url = url[0]+'/';
	}
	ShowLoading();
	$(".berrors").remove();
	
	$.ajax({
		url: url,
		type: "POST",
		method: "POST",
		data: {xsort:1,xs_field:field,xs_value:val}
	}).done(function(d){
		HideLoading();
		var html = $("#dle-content",d).html();
		if(html){
			$("#dle-content").html(html);
			if(url != window.location.href) window.history.pushState(null, null, url);
		}else xsort_empty();
	}).fail(function(d){
		HideLoading();
		xsort_empty();
	})
})
.on('click','body:not(.xsort-ul)',function(){
	$('.xsort-ul').fadeOut(100);
})
.on('click','.xsort-div-filler',function(){
	ShowLoading();
	$('#xsort-admin').remove();
	$('body').append('<div id="xsort-admin" title="Поиск и формирование списка значений доп. полей" style="display:none;"/>');
	$.post(dle_root+"engine/mods/xsort/admin.php",{do:'start'},function(d){
		HideLoading();
		$('#xsort-admin').html(d).dialog({
			width: '600px',
			buttons: {
				'Закрыть':function(){
					$(this).dialog('close');
				}
			}
		});
	})
})
.on('click','.xsort-admin-area ul li',function(){
	var ul = $(this).parents('ul');
	ul.addClass('loading');
	if(!$(this).hasClass('current')) $(this).removeClass('xreverse');
	var reverse = $(this).hasClass('xreverse');
	$(this).toggleClass('xreverse');
	$(this).addClass('current').siblings().removeClass('current');
	$.post(dle_root+"engine/mods/xsort/admin.php",{field:$(this).data('field'),reverse:reverse},function(d){
		ul.removeClass('loading');
		$('.xsort-admin-area pre code').html(d);
	})
})
.on('click','.xsort-div-clearall',function(){
	var url = window.location.href;
	if(url.indexOf('/page/')>=0){
		url = url.split('/page/');
		url = url[0]+'/';
	}
	ShowLoading();
	$(".berrors").remove();
	$.ajax({
		url: url,
		type: "POST",
		method: "POST",
		data: {xsort:1,xs_field:'clearallfields'}
	}).done(function(d){
		HideLoading();
		window.location.href = url;
	}).fail(function(d){
		HideLoading();
		xsort_empty();
	})
})
</script>



<style>
.xsort-area{
	margin-bottom: 5px;
	padding: 0 15px;
	font: normal 12px/32px Arial;
	-ms-user-select: none;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
}
.xsort-area:after{
	content: "";
	display: table;
	clear: both;
}
.xsort-area>div{
	float: left;
	margin: 0 10px 10px 0;
}
.xsort-div{
	height: 30px;
	line-height: 30px;
	padding: 0 10px;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: #fff;
	position: relative;
	-moz-box-sizing: content-box;
	-webkit-box-sizing: content-box;
	box-sizing: content-box;
}
.xsort-div:hover{
	box-shadow: 0 0 0 2px rgba(0,0,0,.2);
}
.xsort-active{
	box-shadow: 0 0 0px 2px #FFB114;
}
.xsort-selected{
	cursor: pointer;
	padding-right: 15px;
	position: relative;
}
.xsort-selected:after{
	position: absolute;
	top: 50%;
	margin-top: -2px;
	right: 0;
	border: 4px solid transparent;
	border-top-color: #777;
	content:"";
}
.xsort-div-filler{
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAvklEQVR42o3KsUqCYRiA0RPVZg6Fg2NgU0ME7g0KTg0SLtHaFYQ0VjRFDUGjEAhBi1vQ1Fx2BVJ4Aa4FQWT6tn38llTnWR//t+7MjY6mgh9mXYjUi4ZvzoVnDUXL9r35VJWxaqxvEcCGkSczkmNhR1ZHKEuuhZKsPWFbcimsyToS6pJd4YRkTs9IUZIzMLQFmNcSbk2oeBfuHDrVF8KHugllj0IIQ23daQsrNtUsIe9BWqbLuxde/WLBlQN/+wLDfD9iwnIihwAAAABJRU5ErkJggg==);
	background-position: 50% 50%;
	width: 32px;
	padding: 0;
	background-repeat: no-repeat;
	cursor: pointer;
}

.xsort-ul{
	display: none;
	background: #fff;
	position: absolute;
	top: 100%;
	left: 0;
	margin: 0;
	padding: 0;
	max-height: 400px;
	overflow: auto;
	list-style: none;
	z-index: 999;
	border: 1px solid #ccc;
	border-radius: 5px;
	box-shadow: 0 0 0 3px rgba(0,0,0,.1);
	box-sizing: content-box;
}
.xsort-ul li{
	display: block;
	border-bottom: 1px solid #eee;
	padding: 0 35px 0 18px;
	line-height: 30px;
	white-space: nowrap;
	cursor: pointer;
	color: #666;
}
.xsort-ul li:last-child{
	border: none;
}
.xsort-ul li.current{
	color: #333;
	font-weight: bold;
	background: #f5f5f7;
	position: relative;
}
.xsort-ul li.current:after{
	position: absolute;
	top:0;
	right: 5px;
	bottom: 0;
	width: 5px;
	content: "";
	display: block;
	background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAQAAAAnZu5uAAAAJUlEQVQY01XIMQEAIAwDsDivroGe6Sg3OQNxBGLVCldVzbfECA+g/g9v8ooTNAAAAABJRU5ErkJggg==) no-repeat 50% 50%
}

.xsort-ul li:hover{
	background: #eee url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAeCAIAAABi9+OQAAAAHElEQVQImWP4+vUrEwMDA9P///+ZGBgY4JjGfAByHhgFbrteLwAAAABJRU5ErkJggg==) repeat-x 0 0;
	color: #000;
}
.xsort-ul li.xdesc, .xsort-ul li.xasc{
	background-position: 6px 50%;
	background-repeat: no-repeat;
}
.xsort-ul li.xdesc, .xdesc{
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAICAQAAACfDS2NAAAAIElEQVQY02NgYGBgSPsPggwwQDQXwoRBFAHsekECEBoASUcnDSh9+RUAAAAASUVORK5CYII=);
}
.xsort-ul li.xasc, .xasc{
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAICAQAAACfDS2NAAAAHklEQVQYV2NgAIO0/xAaygFBFA5UAMGBq0BRTDwXAPWMJw0b8PLnAAAAAElFTkSuQmCC);
}
span.xasc, span.xdesc{
	padding-left: 10px;
	background-position: 0 50%;
	background-repeat: no-repeat;
}

.xsort_empty{
	margin-top: 15px;
	background: #fff;
	border: 1px solid #ccc;
	padding: 15px;
	text-align: center;
	color: #444;
	border-radius: 3px;
	box-shadow: 0 2px 7px rgba(0,0,0,.1);
}

.xsort-admin-area{
	padding: 0 0 0 210px;
}
.xsort-admin-area:after{
	content: "";
	display: block;
	clear: both;
}
.xsort-admin-area ul{
	list-style: none;
	margin: 0 0 0 -210px;
	padding: 0;
	float: left;
	width: 200px;
	border-right: 1px solid #ddd;
}
.xsort-admin-area ul.loading{
	background: url(data:image/GIF;base64,R0lGODlhFAAUAPUEAPz6/PT29Pz+/PTy9Hx+fHx6fIyKjLSytISChOzq7MTCxJyanOTm5NTS1Nza3MzOzKSmpJyenOTi5Ozu7IyOjMTGxMzKzJSWlLy6vKyurLS2tLy+vJSSlNze3KSipKyqrNTW1P///wAAAAAAAA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V5BQ9sZ2gQBwcRCFQHAk8PUlTQBsF8AUZSBAYRD2tDQQAh+QQFBQALACwBAAAAEwAUAAAGjMCFcAF4QAyEwSAAGDqFDUNhWlBam07BgUqIZAKBQUIZcG4LBEV5KACToVND4sm2lhEEwpxeVy4IBQp8T2FLaFiDQgJkBRGJhEoFGY9OhZKUQ2EJjZhCYQGHmIuRgZiFAVJ6j6MDCw+AcoOsa2cIalkAdmwZXBAZBxENY0t0D1JUUxCfg0VHeQYZiENBACH5BAkFAAIALAEAAgANABIAAAYxQIFwKDwQj8ikcslsOptG6HNKVSIICGajQCUIAMdAUeA1BM6BwQAJUbvXQ7FDnUgHggAh+QQJBQALACwAAAIAFAASAAAGasDFQnAoGAmRQyAwSAifz2KBUAlABVaosGE0OLXgJ4JA+IbDhELlzJ4C2OdCBK5NWAsHehivhw4Wcn1Pf26CC3cFCoZCYwhmfVwUDAJnb2AVCQMDAZRPApZhTJqbS0yPYEujqn90qZmkYEEAIfkEBQUACwAsAAACABQAEgAABoDAxUJwKBgJkUMgMEgMBgGhtFggKKJSwfKJXTSMhoR0PHxCFwAEgSAmjwXmxYNQULjdTCikCriT4VAGBRF+eE9GB4VkeXSJilJMCRobEo+QUHkClnAJAQBOXYUAXAuZiqNPQqgDmncAeV15UK1CAqidi2aYW05nhrrAoXiRXMILQQAh+QQJBQAAACwAAAIAFAAPAAAGNkCAcEgsGouVo3LJNBSYxwAokoQSA4OBwErMBrjdwRecyCbG4KwYLBywh25AnJuAv4foe3oYBAAh+QQFBQAFACwAAAEAFAATAAAGecCCsCAZCicD5ABgHAYmCAIhcggEBslBoHkdNBTboQCQDRfIk4CgKb5OmIVkAM4WkrFnrLkudAOeanxGAnp6glxpcodGaIaLfViKjwVPWlhri4RaAEh7fGhMkZifkpyXn110bkujBWNlXFlaVqtpdX9KkUp0t6ubbEEAOw==) no-repeat 50% 50%;
}
.xsort-admin-area ul li{
	display: block;
	color: #f43;
	cursor: pointer;
	padding: 1px 0;
}
.xsort-admin-area ul li.current,
.xsort-admin-area ul li:hover{
	color: #000;
}
.xsort-admin-area ul li.current{
	font-weight: bold;
}
.xsort-admin-area p{
	margin: 0;
	padding: 7px 0 0;
}
.xsort-admin-area code{
	max-height: 400px;
	overflow: auto;
}
.xsort-div-clearall{
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAAKklEQVQoz2NgGATA4L/Bf3QWmrTBfwSNQwEOSWQT8EjiNRqnCQRcPgAAAG+mJxC7ICdhAAAAAElFTkSuQmCC);
	background-position: 50% 50%;
	width: 32px;
	padding: 0;
	background-repeat: no-repeat;
	cursor: pointer;
}

</style>



[aviable=main|cat|xfsearch]
<div class="xsort-area ignore-select">
	<div>Сортировать по:</div>
	[category=2,3]{include file="engine/mods/xsort/selected.php?fields=year,genre,actors,strana,oscar,hd,ru"}[/category]
	[not-category=2,3]{include file="engine/mods/xsort/selected.php"}[/not-category]
	<div class="xsort-div xsort-div-clearall" title="Сбросить выбранные значения"></div>
	[group=1]<div class="xsort-div xsort-div-filler" title="Поиск значений полей"></div>[/group]
</div>
[/aviable]

Thank you in advance for your help .
 

Ссылка на сообщение
Поделиться на других сайтах
18 часов назад, snovop сказал:

"Xsort by sander" module

This is not Sander`s support forum, try here: http://sandev.pro/shop/84-xsort-by-sander.html

Изменено пользователем odys
Ссылка на сообщение
Поделиться на других сайтах

Присоединяйтесь к обсуждению

Вы можете опубликовать сообщение сейчас, а зарегистрироваться позже. Если у вас есть аккаунт, войдите в него для написания от своего имени.

Гость
Ответить в тему...

×   Вставлено в виде отформатированного текста.   Вставить в виде обычного текста

  Разрешено не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отобразить как ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставить изображения напрямую. Загрузите или вставьте изображения по ссылке.

×
×
  • Создать...