onClose(e){
let activeEle: any = this.mulObj.ulElement.querySelectorAll('li.e-active');
let reorderEle: any = (this.mulObj as any).popupObj.element.querySelectorAll('ul.e-reorder li.e-active');
reorderEle = Array.prototype.slice.call(reorderEle);
activeEle = Array.prototype.slice.call(activeEle);
activeEle = (reorderEle.length > 0 && activeEle.length > 0) ? reorderEle.concat(activeEle) : (reorderEle.length > 0) ? reorderEle : activeEle;
let reOderVal: any = [];
for (let i: number = 0; i < activeEle.length; i++) {
reOderVal.push((activeEle[i] as HTMLElement).innerText);
}
let label: any = (this.mulObj as any).delimiterWrapper.nextElementSibling;
let splitEle: any;
if (label.querySelector('.e-remain')) {
splitEle = label.innerHTML.split('<span');
reOderVal.splice(splitEle[0].split(',').length);
splitEle[0] = reOderVal;
let ele1: any = splitEle[0].toString();
let ele2: any = '<span' + splitEle[1];
label.innerHTML = ele1 + ele2;
} else {
splitEle = label.innerHTML.split(',');
label.innerHTML = reOderVal.toString();
}
this.mulObj.value = (this.mulObj.value as any).sort();
} |