!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('<span class="current"></span><ul class="list"></ul>'));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("<li></li>").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery);
jQuery(document).ready(function($){
'use strict';
$('.rhniceselect, .woocommerce-ordering .orderby').niceSelect();
});
jQuery(document).on('change', '.rh_woo_drop_cat', function(e){
var catid=jQuery(this).val(),
inputField=jQuery(this).parent().find('.re-ajax-search');
if(inputField.length){
inputField.attr("data-catid", catid);
var inputValue=inputField.val();
if(inputValue!=''){
re_ajax_cache.remove(inputValue);
re_ajax_search.do_ajax_call(inputField);
}}
});
jQuery(document).on('mouseenter', '.user-rate-active .starrate' , function (e){
var rated=jQuery(this);
var rateditem=jQuery(this).closest('.user-rate');
var current_rated_count=rated.attr('data-ratecount');
if(rateditem.hasClass('rated-done')){
return false;
}
rateditem.find('.starrate').removeClass('active');
for (i=1; i <=current_rated_count; i++){
rateditem.find('.starrate'+i).addClass('active');
}});
jQuery(document).on('mouseleave', '.user-rate-active .starrate' , function (e){
var rated=jQuery(this);
var rateditem=jQuery(this).closest('.user-rate');
var current_rateddiv=rateditem.attr('data-rate');
if(rateditem.hasClass('rated-done')){
return false;
}
rateditem.find('.starrate').removeClass('active');
for (i=1; i <=current_rateddiv; i++){
rateditem.find('.starrate'+i).addClass('active');
}});
jQuery(document).on('click', '.user-rate-active .starrate' , function (e){
var rated=jQuery(this);
var rateditem=jQuery(this).closest('.user-rate');
var current_rated_count=rated.attr('data-ratecount');
if(rateditem.hasClass('rated-done')){
return false;
}
rateditem.find('.post-norsp-rate').hide();
rateditem.append('<span class="rehub-rate-load"><i class="rhicon rhi-circle-notch rhi-spin"></i></span>');
var post_id=rateditem.attr('data-id');
var rate_type=rateditem.attr('data-ratetype');
var numVotes=rateditem.parent().find('.userrating-count').text();
jQuery.post(rhscriptvars.ajax_url, { action:'rehub_rate_post' , post:post_id , type:rate_type , value:current_rated_count, security: rhscriptvars.nonce}, function(data){
if(data){
var post_rateed='.rate-post-'+post_id;
jQuery(post_rateed).addClass('rated-done').attr('data-rate',data);
for (i=1; i <=current_rated_count; i++){
rateditem.find('.starrate'+i).addClass('active');
}
jQuery(".rehub-rate-load").fadeOut(function (){
rateditem.parent().find('.userrating-score').html(current_rated_count);
if((jQuery(rateditem.parent().find('.userrating-count'))).length > 0){
numVotes=parseInt(numVotes)+1;
rateditem.parent().find('.userrating-count').html(numVotes);
}else{
rateditem.parent().find('small').hide();
}
rateditem.parent().find('strong').html(rhscriptvars.your_rating);
rateditem.find('.post-norsp-rate').fadeIn();
});
}}, 'html');
return false;
});
jQuery(document).ready(function($){
'use strict';
$('.re_filter_panel').on('click', '.re_filtersort_btn:not(.active)', function(e){
e.preventDefault();
var $this=$(this);
var containerid=$this.data('containerid');
var activecontainer=$('#'+containerid);
var sorttype=$this.data('sorttype');
var filterPanel=activecontainer.siblings('.re_filter_panel');
var choosenTax=filterPanel.find('.re_tax_dropdown .rh_choosed_tax');
var tax;
if(choosenTax.length > 0&&choosenTax.html()!=''){
tax=choosenTax.attr('data-taxdata');
if(tax){
tax=JSON.parse(tax);
}}
var filterargs=activecontainer.data('filterargs');
var innerargs=activecontainer.data('innerargs');
var template=activecontainer.data('template');
var data={
'action': 're_filterpost',
'sorttype': sorttype,
'filterargs':filterargs,
'tax': tax,
'template':template,
'containerid':containerid,
'innerargs':innerargs,
'security':rhscriptvars.filternonce
};
$this.closest('ul').addClass('activeul');
$this.addClass('re_loadingbefore');
activecontainer.addClass('sortingloading');
$.ajax({
type: "POST",
url: rhscriptvars.ajax_url,
data: data
}).done(function(response){
if(response!=='fail'){
if(activecontainer.parent().hasClass('rh-gsap-wrap')||activecontainer.parent().parent().hasClass('rh-gsap-wrap')){
var elapend=$(response);
activecontainer.html(elapend);
var current=activecontainer.closest('.rh-gsap-wrap');
var $batchobj=elapend.filter('.col_item');
var anargs=RHGetBasicTween(current);
RHBatchScrollTrigger(current, anargs, $batchobj);
}else{
activecontainer.html($(response).hide().fadeIn(1000));
}
activecontainer.find('.radial-progress').each(function(){
$(this).find('.circle .mask.full, .circle .fill:not(.fix)').animate({  borderSpacing: $(this).attr('data-rating')*18 }, {
step: function(now,fx){
$(this).css('-webkit-transform','rotate('+now+'deg)');
$(this).css('-moz-transform','rotate('+now+'deg)');
$(this).css('transform','rotate('+now+'deg)');
},
duration:'slow'
},'linear');
$(this).find('.circle .fill.fix').animate({  borderSpacing: $(this).attr('data-rating')*36 }, {
step: function(now,fx){
$(this).css('-webkit-transform','rotate('+now+'deg)');
$(this).css('-moz-transform','rotate('+now+'deg)');
$(this).css('transform','rotate('+now+'deg)');
},
duration:'slow'
},'linear');
});
activecontainer.find('.wpsm-tooltip').each(function(){
$(this).tipsy({gravity: "s", fade: true, html: true });
});
activecontainer.find('.wpsm-bar').each(function(){
$(this).find('.wpsm-bar-bar').animate({ width: $(this).attr('data-percent') }, 1500);
});
activecontainer.find('.countdown_dashboard').each(function(){
$(this).show();
var id=$(this).attr("id");
var day=$(this).attr("data-day");
var month=$(this).attr("data-month");
var year=$(this).attr("data-year");
var hour=$(this).attr("data-hour");
var min=$(this).attr("data-min");
$(this).countDown({
targetDate: {
"day":      day,
"month":    month,
"year":     year,
"hour":     hour,
"min":      min,
"sec":      0
},
omitWeeks: true,
onComplete: function(){ $("#"+ id).hide() }});
});
}
$this.closest('.re_filter_panel').find('span').removeClass('active');
$this.removeClass('re_loadingbefore').addClass('active');
activecontainer.removeClass('sortingloading');
$this.closest('ul').removeClass('activeul');
if($this.closest('ul').hasClass('re_tax_dropdown')){
var taxDropdown=$this.closest('.re_tax_dropdown');
taxDropdown.find('.rh_choosed_tax').html($this.html()).show().attr('data-taxdata', $this.attr('data-sorttype'));
taxDropdown.find('.rh_tax_placeholder').hide();
filterPanel.find('.re_filter_ul li:first-child span').addClass('active');
}});
});
$('.re_filter_panel').on('click', '.re_filter_ul .re_filtersort_btn.active', function(e){
e.preventDefault();
$(this).closest('.re_filter_panel').find('ul.re_filter_ul span').toggleClass('showfiltermobile');
});
$('.re_tax_dropdown').on('click', '.label', function(e){
e.stopPropagation();
e.preventDefault();
$(this).closest('.re_tax_dropdown').toggleClass('active');
});
$(document).on('click', function(){
$('.re_tax_dropdown').removeClass('active');
});
});
jQuery(document).ready(function($){
'use strict';
$(document).on('click', '.re_ajax_pagination_btn', function(e){
e.preventDefault();
var $this=$(this);
var containerid=$this.data('containerid');
var activecontainer=$('#'+containerid);
var sorttype=$this.data('sorttype');
var filterPanel=activecontainer.siblings('.re_filter_panel');
var choosenTax=filterPanel.find('.re_tax_dropdown .rh_choosed_tax');
var tax;
if(choosenTax.length > 0&&choosenTax.html()!=''){
tax=choosenTax.attr('data-taxdata');
if(tax){
tax=JSON.parse(tax);
}}
var offset=$this.data('offset');
var filterargs=activecontainer.data('filterargs');
var innerargs=activecontainer.data('innerargs');
var template=activecontainer.data('template');
var data={
'action': 're_filterpost',
'sorttype': sorttype,
'filterargs':filterargs,
'tax': tax,
'template':template,
'containerid':containerid,
'offset':offset,
'innerargs':innerargs,
'security':rhscriptvars.filternonce
};
$this.parent().find('span').removeClass('active_ajax_pagination');
$this.addClass('active_ajax_pagination');
$.ajax({
type: "POST",
url: rhscriptvars.ajax_url,
data: data
}).done(function(response){
if(response!=='fail'){
activecontainer.find('.re_ajax_pagination').remove();
if(activecontainer.parent().hasClass('rh-gsap-wrap')||activecontainer.parent().parent().hasClass('rh-gsap-wrap')){
var elapend=$(response);
activecontainer.append(elapend);
var current=activecontainer.closest('.rh-gsap-wrap');
var $batchobj=elapend.filter('.col_item');
var anargs=RHGetBasicTween(current);
RHBatchScrollTrigger(current, anargs, $batchobj);
}else{
activecontainer.append($(response).hide().fadeIn(1000));
}
activecontainer.find('.radial-progress').each(function(){
$(this).find('.circle .mask.full, .circle .fill:not(.fix)').animate({  borderSpacing: $(this).attr('data-rating')*18 }, {
step: function(now,fx){
$(this).css('-webkit-transform','rotate('+now+'deg)');
$(this).css('-moz-transform','rotate('+now+'deg)');
$(this).css('transform','rotate('+now+'deg)');
},
duration:'slow'
},'linear');
$(this).find('.circle .fill.fix').animate({  borderSpacing: $(this).attr('data-rating')*36 }, {
step: function(now,fx){
$(this).css('-webkit-transform','rotate('+now+'deg)');
$(this).css('-moz-transform','rotate('+now+'deg)');
$(this).css('transform','rotate('+now+'deg)');
},
duration:'slow'
},'linear');
});
activecontainer.find('.wpsm-tooltip').each(function(){
$(this).tipsy({gravity: "s", fade: true, html: true });
});
activecontainer.find('.wpsm-bar').each(function(){
$(this).find('.wpsm-bar-bar').animate({ width: $(this).attr('data-percent') }, 1500);
});
activecontainer.find('.countdown_dashboard').each(function(){
$(this).show();
var id=$(this).attr("id");
var day=$(this).attr("data-day");
var month=$(this).attr("data-month");
var year=$(this).attr("data-year");
var hour=$(this).attr("data-hour");
var min=$(this).attr("data-min");
$(this).countDown({
targetDate: {
"day":      day,
"month":    month,
"year":     year,
"hour":     hour,
"min":      min,
"sec":      0
},
omitWeeks: true,
onComplete: function(){ $("#"+ id).hide() }});
});
}}
);
});
$(document).on('inview', '.re_aj_pag_auto_wrap .re_ajax_pagination_btn', function(e){
e.preventDefault();
var $this=$(this);
var containerid=$this.data('containerid');
var activecontainer=$('#'+containerid);
var sorttype=$this.data('sorttype');
var offset=$this.data('offset');
var filterPanel=activecontainer.siblings('.re_filter_panel');
var choosenTax=filterPanel.find('.re_tax_dropdown .rh_choosed_tax');
var tax;
if(choosenTax.length > 0&&choosenTax.html()!=''){
tax=choosenTax.attr('data-taxdata');
if(tax){
tax=JSON.parse(tax);
}}
var filterargs=activecontainer.data('filterargs');
var innerargs=activecontainer.data('innerargs');
var template=activecontainer.data('template');
var data={
'action': 're_filterpost',
'sorttype': sorttype,
'filterargs':filterargs,
'template':template,
'tax': tax,
'containerid':containerid,
'offset':offset,
'innerargs':innerargs,
'security':rhscriptvars.filternonce
};
$this.parent().find('span').removeClass('re_ajax_pagination_btn');
$this.parent().find('span').removeClass('active_ajax_pagination');
$this.addClass('active_ajax_pagination');
$.ajax({
type: "POST",
url: rhscriptvars.ajax_url,
data: data
}).done(function(response){
if(response!=='fail'){
activecontainer.find('.re_ajax_pagination').remove();
if(activecontainer.parent().hasClass('rh-gsap-wrap')||activecontainer.parent().parent().hasClass('rh-gsap-wrap')){
var elapend=$(response);
activecontainer.append(elapend);
var current=activecontainer.closest('.rh-gsap-wrap');
var $batchobj=elapend.filter('.col_item');
var anargs=RHGetBasicTween(current);
RHBatchScrollTrigger(current, anargs, $batchobj);
}else{
activecontainer.append($(response).hide().fadeIn(1000));
}
activecontainer.find('.radial-progress').each(function(){
$(this).find('.circle .mask.full, .circle .fill:not(.fix)').animate({  borderSpacing: $(this).attr('data-rating')*18 }, {
step: function(now,fx){
$(this).css('-webkit-transform','rotate('+now+'deg)');
$(this).css('-moz-transform','rotate('+now+'deg)');
$(this).css('transform','rotate('+now+'deg)');
},
duration:'slow'
},'linear');
$(this).find('.circle .fill.fix').animate({  borderSpacing: $(this).attr('data-rating')*36 }, {
step: function(now,fx){
$(this).css('-webkit-transform','rotate('+now+'deg)');
$(this).css('-moz-transform','rotate('+now+'deg)');
$(this).css('transform','rotate('+now+'deg)');
},
duration:'slow'
},'linear');
});
activecontainer.find('.wpsm-tooltip').each(function(){
$(this).tipsy({gravity: "s", fade: true, html: true });
});
activecontainer.find('.wpsm-bar').each(function(){
$(this).find('.wpsm-bar-bar').animate({ width: $(this).attr('data-percent') }, 1500);
});
activecontainer.find('.countdown_dashboard').each(function(){
$(this).show();
var id=$(this).attr("id");
var day=$(this).attr("data-day");
var month=$(this).attr("data-month");
var year=$(this).attr("data-year");
var hour=$(this).attr("data-hour");
var min=$(this).attr("data-min");
$(this).countDown({
targetDate: {
"day":      day,
"month":    month,
"year":     year,
"hour":     hour,
"min":      min,
"sec":      0
},
omitWeeks: true,
onComplete: function(){ $("#"+ id).hide() }});
});
}}
);
});
});