plxdcma_eshop
Version:
Instala todo lo necesario para una tienda virtual
49 lines (41 loc) • 1.59 kB
JavaScript
function showShopReloadCaracteristics(datasource,delegate){
shopSellCaracteristics.style.display="block"
shopTableItems.style.display="none"
showhopcaracteristicsdatasource=datasource
showhopcaracteristicsdelegate=delegate
reloadshowShopReloadCaracteristics()
}
function reloadshowShopReloadCaracteristics(){
shopPropertiesList.innerHTML=""
var n=showhopcaracteristicsdatasource.numberOfCaracteristics()
var texts=[]
for(var i = 0 ; i < n;i++){
texts.push(showhopcaracteristicsdatasource.textOfCaracteristics(i))
}
rerenderRowsWithRemoveBtns(texts,true,function(index,html,text,icon){
if(showhopcaracteristicsdatasource.isApproved(index)){
icon.classList.remove("fa-times")
icon.classList.add("fa-check")
icon.classList.add("shophoverabletouchswitchCheck")
}else{
icon.classList.add("shophoverabletouchswitchX")
}
icon.classList.add("shophoverabletouchswitch")
icon.onclick=function(){
var icon=this.html
var state=showhopcaracteristicsdelegate.didTouchActivityIcon(this.index,icon)
icon.classList.remove("fa-times")
icon.classList.remove("fa-check")
icon.classList.remove("shophoverabletouchswitchX")
icon.classList.remove("shophoverabletouchswitchCheck")
if(state){
icon.classList.add("fa-check")
icon.classList.add("shophoverabletouchswitchCheck")
}else{
icon.classList.add("fa-times")
icon.classList.add("shophoverabletouchswitchX")
}
}.bind({index:index,html:icon})
shopPropertiesList.appendChild(html)
})
}