BX.namespace("BX.Admin.DraggableTab"); BX.Admin.DraggableTab = (function() { var DraggableTab = function(arParams) { if (typeof arParams !== "object") return; this.moduleId = arParams.moduleId; this.tabId = arParams.tabId; this.optionName = arParams.optionName; this.hidden = arParams.hidden; this.dragObjects = BX(this.tabId).querySelectorAll('[data-role="dragObj"]'); if (typeof this.dragObjects !== "object") return; BX.loadScript("/bitrix/js/main/dd.js"); for(var i=0; i this.bxSectParentHeight - this.objSectHeight) y = this.bxSectParentHeight - this.objSectHeight; this.bxSectBlock.style.top = y + 'px'; }; DraggableTab.prototype.sectionDragHover = function(dest, x, y) { var dragElement = BX.proxy_context.parentNode.parentNode.parentNode; if (dest == dragElement) { this.bxSectParent.insertBefore(this.bxSectBlank1, this.bxSectBlank); } else if (dest.parentNode == this.bxSectParent) { if (dest.nextSibling) this.bxSectParent.insertBefore(this.bxSectBlank1, dest.nextSibling); else this.bxSectParent.appendChild(this.bxSectBlank1); } }; DraggableTab.prototype.sectionDragStop = function() { var dragElement = BX.proxy_context.parentNode.parentNode.parentNode; if (this.bxSectBlank1 && this.bxSectBlank1.parentNode == this.bxSectParent) { this.bxSectParent.replaceChild(dragElement, this.bxSectBlank1); } else { this.bxSectParent.replaceChild(dragElement, this.bxSectBlank); } this.bxSectParent.style.height = ""; BX.remove(this.bxSectBlock); BX.remove(this.bxSectBlank); BX.remove(this.bxSectBlank1); jsDD.enableDest(dragElement); var allDragObj = this.bxSectParent.querySelectorAll('[data-role="dragObj"]'); var objOrder = []; for(var i=0; i