componentDidMount() { const wrapperNode = this.wrapperRef; if (wrapperNode != null) { this.setState({ sidebarWidth: wrapperNode.offsetWidth, }); } }
function onMouseDown(event){ var touchEvent = event.targetTouches ? event.targetTouches[0] : event; diffX = touchEvent.clientX - divDomToolsPannel.offsetLeft; diffY = touchEvent.clientY - divDomToolsPannel.offsetTop; isDrag = true; }
export function html( blob, options ) { const div = document.createElement( 'div' ); div.appendChild( convert( blob, options ) ); return div.innerHTML; }
getIdealLocation(anchor, position) { const clearance = this.getNodeClearance(this.triggerNode); const isVertical = this.isVertical(position); const tooltipRect = this.tooltipNode.getBoundingClientRect(); const tooltipHeight = tooltipRect.height + ARROW_SIZE; const tooltipWidth = tooltipRect.width + ARROW_SIZE; anchor = this.getAnchor(isVertical, anchor, clearance, tooltipWidth, tooltipHeight); position = this.getPosition(position, clearance, tooltipWidth, tooltipHeight); const coordinates = this.getCoordinates(position, clearance, tooltipWidth, tooltipHeight); return {anchor, position, coordinates}; }
handleMouseUp() { UIStore.removeGlobalStyle(mouseDownStyles); global.document.removeEventListener('mouseup', this.handleMouseUp); global.document.removeEventListener('mousemove', this.handleMouseMove); this.isMouseDown = false; this.lastMouseX = null; this.resizeLine.style.opacity = 0; this.updateCellWidth(this.focusedCell, this.focusedCellWidth); this.focusedCell = null; this.focusedCellWidth = null; }
hideMenu(ev) { // check default prevented if (ev && ev.defaultPrevented) return; // remove event listeners jqLite.off(window, 'resize', this.hideMenuCB); jqLite.off(document, 'click', this.hideMenuCB); // re-draw this.setState({ showMenu: false }); // refocus this.wrapperElRef.focus(); }
this.setState({ currentIndex: (this.state.currentIndex + 1) % React.Children.count(children), }, () => { setTimeout(() => { if (this.textRotatorWrap) { this.textRotatorWrap.classList.add('text-rotater--slide-up'); } }, repeatDelay); });
divDomDialog.addEventListener('keydown', function(event){ var keyCode = event.keyCode; if(keyCode === 13 && (event.ctrlKey || event.metaKey)){ okCallback(); } });
hide() { try { if ($loading.parentNode === $body) { $loading.style.opacity = 0; setTimeout(() => { $body.removeChild($loading); }, 200); } } catch (e) { } }
hide() { try { if ($loading.parentNode === $body) { $body.removeChild($loading); } } catch (e) { } }
// 隐藏对话框 function hideDialog(){ domDialogTitle.innerHTML = ''; domDialogContent.innerHTML = ''; divDomDialog.style.display = 'none'; isShowDialog = false; }
function escapeHtml(str) { var div = document.createElement("div"); div.appendChild(document.createTextNode(str)); return div.innerHTML; }