Subversion Repositories SmartDukaan

Rev

Rev 27974 | Rev 28018 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27974 Rev 27975
Line 117... Line 117...
117
		alert("Cant remove single Slab");
117
		alert("Cant remove single Slab");
118
	}
118
	}
119
});
119
});
120
$(document).on('click', 'button.slab-copy', function(){
120
$(document).on('click', 'button.slab-copy', function(){
121
	newTargetSlab = $('div.targetslabs').eq(0).clone().appendTo('div.targetslabscontainer');
121
	newTargetSlab = $('div.targetslabs').eq(0).clone().appendTo('div.targetslabscontainer');
-
 
122
	catalogIdSelectContainers = $('div.targetslabs').eq(0).find('select.criteria-catalogids');
-
 
123
	newCatalogIdSelectContainers = newTargetSlab.find('select.criteria-catalogids');
-
 
124
	for(let i=0;i<4;i++) {
-
 
125
		let selectContainer = catalogIdSelectContainers.get(i);
-
 
126
		let newSelectContainer = newCatalogIdSelectContainers.get(i);
-
 
127
		for(let j=0;j<selectContainer.options.length;j++) {
-
 
128
			newSelectContainer.options[j].selected = selectContainer.options[j].selected;
-
 
129
		}
-
 
130
		newSelectContainer.closest('span').replaceWith(newSelectContainer);
-
 
131
		$(newSelectContainer).multiselect({
-
 
132
			includeSelectAllOption : true,
-
 
133
			maxHeight : 400,
-
 
134
			buttonWidth : '240px',
-
 
135
			numberDisplayed : 1,
-
 
136
			nonSelectedText : 'Items',
-
 
137
			nSelectedText : ' - Items Selected',
-
 
138
			allSelectedText : 'All Items Selected',
-
 
139
			enableFiltering : true,
-
 
140
			enableCaseInsensitiveFiltering : true,
-
 
141
		});
-
 
142
	}
122
	selectContainers = newTargetSlab.find("select.criteria-brands");
143
	selectContainers = newTargetSlab.find("select.criteria-brands");
123
	selectContainers.each((y,x)=>{
144
	selectContainers.each((y,x)=>{
124
		$next = $(x).toggle().next();
145
		$next = $(x).toggle().next();
125
		$next.find("a.search-choice-close").each(function(index,ele){
146
		$next.find("a.search-choice-close").each(function(index,ele){
126
			x.options[$(ele).data('option-array-index') + 0].selected=true; 
147
			x.options[$(ele).data('option-array-index') + 0].selected=true;