Skip to content

Instantly share code, notes, and snippets.

@avishai84
Last active June 28, 2018 21:11
Show Gist options
  • Select an option

  • Save avishai84/33114b497d782fc43a350170ba1518d5 to your computer and use it in GitHub Desktop.

Select an option

Save avishai84/33114b497d782fc43a350170ba1518d5 to your computer and use it in GitHub Desktop.
facet fn
function setFacetSelectHandlers(dataCid){
this.dataCid = dataCid;
var hashLoc = location.hash,
dept = '';
//check if dept exist;
(gap.viewModel.facetManager.k_hasDepartment()) ? dept = gap.viewModel.departmentFacet.k_selectedDepartment() : dept = false;
if(dept != false){
hashLoc.indexOf('&style')>-1?hashLoc='#pageId=0&department='+dept+'&style='+dataCid:hashLoc+="&style="+dataCid;
}else{
hashLoc.indexOf('&style')>-1?hashLoc='#pageId=0&style='+dataCid:hashLoc+="&style="+dataCid;
}
location.hash =hashLoc;
var topPos = document.querySelector('.l--cat-page-photos').offsetTop;
jQuery("html, body").animate({
scrollTop : topPos - 150
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment