當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript styleMutator.StyleMutator類代碼示例

本文整理匯總了TypeScript中vs/base/browser/styleMutator.StyleMutator的典型用法代碼示例。如果您正苦於以下問題:TypeScript StyleMutator類的具體用法?TypeScript StyleMutator怎麽用?TypeScript StyleMutator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了StyleMutator類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: _renderWidget

	private _renderWidget(widgetData: IWidgetData): void {
		var _RESTORE_STYLE_TOP = 'data-editor-restoreStyleTop',
			domNode = widgetData.widget.getDomNode();

		if (widgetData.preference === null) {
			if (domNode.hasAttribute(_RESTORE_STYLE_TOP)) {
				var previousTop = domNode.getAttribute(_RESTORE_STYLE_TOP);
				domNode.removeAttribute(_RESTORE_STYLE_TOP);
				domNode.style.top = previousTop;
			}
			return;
		}

		if (widgetData.preference === OverlayWidgetPositionPreference.TOP_RIGHT_CORNER) {
			if (!domNode.hasAttribute(_RESTORE_STYLE_TOP)) {
				domNode.setAttribute(_RESTORE_STYLE_TOP, domNode.style.top);
			}
			StyleMutator.setTop(domNode, 0);
			StyleMutator.setRight(domNode, (2 * this._verticalScrollbarWidth));
		} else if (widgetData.preference === OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER) {
			if (!domNode.hasAttribute(_RESTORE_STYLE_TOP)) {
				domNode.setAttribute(_RESTORE_STYLE_TOP, domNode.style.top);
			}
			var widgetHeight = domNode.clientHeight;
			StyleMutator.setTop(domNode, (this._editorHeight - widgetHeight - 2 * this._horizontalScrollbarHeight));
			StyleMutator.setRight(domNode, (2 * this._verticalScrollbarWidth));
		} else if (widgetData.preference === OverlayWidgetPositionPreference.TOP_CENTER) {
			if (!domNode.hasAttribute(_RESTORE_STYLE_TOP)) {
				domNode.setAttribute(_RESTORE_STYLE_TOP, domNode.style.top);
			}
			StyleMutator.setTop(domNode, 0);
			domNode.style.right = '50%';
		}
	}
開發者ID:1424667164,項目名稱:vscode,代碼行數:34,代碼來源:overlayWidgets.ts

示例2: addZone

	public addZone(zone: IViewZone): number {
		let props = this._computeWhitespaceProps(zone);
		let whitespaceId = this._whitespaceManager.addWhitespace(props.afterViewLineNumber, this._getZoneOrdinal(zone), props.heightInPx);

		let myZone: IMyViewZone = {
			whitespaceId: whitespaceId,
			delegate: zone,
			isVisible: false
		};

		this._safeCallOnComputedHeight(myZone.delegate, props.heightInPx);

		myZone.delegate.domNode.style.position = 'absolute';
		myZone.delegate.domNode.style.width = '100%';
		StyleMutator.setDisplay(myZone.delegate.domNode, 'none');
		myZone.delegate.domNode.setAttribute('monaco-view-zone', myZone.whitespaceId.toString());
		this.domNode.appendChild(myZone.delegate.domNode);

		if (myZone.delegate.marginDomNode) {
			myZone.delegate.marginDomNode.style.position = 'absolute';
			myZone.delegate.marginDomNode.style.width = '100%';
			StyleMutator.setDisplay(myZone.delegate.marginDomNode, 'none');
			myZone.delegate.marginDomNode.setAttribute('monaco-view-zone', myZone.whitespaceId.toString());
			this.marginDomNode.appendChild(myZone.delegate.marginDomNode);
		}

		this._zones[myZone.whitespaceId.toString()] = myZone;


		this.setShouldRender();

		return myZone.whitespaceId;
	}
開發者ID:StateFarmIns,項目名稱:vscode,代碼行數:33,代碼來源:viewZones.ts

示例3: _updateSlider

	protected _updateSlider(sliderSize: number, sliderPosition: number): void {
		StyleMutator.setWidth(this.slider, sliderSize);
		if (!this._forbidTranslate3dUse && Browser.canUseTranslate3d) {
			StyleMutator.setTransform(this.slider, 'translate3d(' + sliderPosition + 'px, 0px, 0px)');
		} else {
			StyleMutator.setLeft(this.slider, sliderPosition);
		}
	}
開發者ID:ErickWendel,項目名稱:vscode,代碼行數:8,代碼來源:horizontalScrollbar.ts

示例4: render

	public render(ctx:EditorBrowser.IRestrictedRenderingContext): void {
		if (this._isInViewport) {
			StyleMutator.setDisplay(this._domNode, 'block');
			StyleMutator.setLeft(this._domNode, this._positionLeft);
			StyleMutator.setTop(this._domNode, this._positionTop + ctx.viewportTop - ctx.bigNumbersDelta);
		} else {
			StyleMutator.setDisplay(this._domNode, 'none');
		}
	}
開發者ID:ErickWendel,項目名稱:vscode,代碼行數:9,代碼來源:viewCursor.ts

示例5:

		this._requestModificationFrame(() => {
			if (!myZone.delegate.domNode.hasAttribute('monaco-view-zone')) {
				// Do not position zone if it was removed in the meantime
				return;
			}
			myZone.delegate.domNode.style.position = 'absolute';
			StyleMutator.setHeight(myZone.delegate.domNode, computedHeight);
			myZone.delegate.domNode.style.width = '100%';
			StyleMutator.setDisplay(myZone.delegate.domNode, 'none');
		});
開發者ID:1424667164,項目名稱:vscode,代碼行數:10,代碼來源:viewZones.ts

示例6: _createCursorDomNode

	private _createCursorDomNode(isSecondary: boolean): HTMLElement {
		var domNode = document.createElement('div');
		domNode.className = 'cursor';
		if (isSecondary) {
			domNode.className += ' secondary';
		}
		StyleMutator.setHeight(domNode, this._lineHeight);
		StyleMutator.setTop(domNode, 0);
		StyleMutator.setLeft(domNode, 0);
		domNode.setAttribute('role', 'presentation');
		domNode.setAttribute('aria-hidden', 'true');
		return domNode;
	}
開發者ID:1833183060,項目名稱:vscode,代碼行數:13,代碼來源:viewCursor.ts

示例7: render

	public render(ctx:IRestrictedRenderingContext): void {
		StyleMutator.setWidth(this.domNode, this._editorWidth);

		let keys = Object.keys(this._widgets);
		for (let i = 0, len = keys.length; i < len; i++) {
			let widgetId = keys[i];
			this._renderWidget(this._widgets[widgetId]);
		}
	}
開發者ID:Clizhuowei,項目名稱:vscode,代碼行數:9,代碼來源:overlayWidgets.ts

示例8:

		this._requestModificationFrameBeforeRendering(() => {
			// update the maxWidth on widgets nodes, such that `onReadAfterForcedLayout`
			// below can read out the adjusted width/height of widgets
			let widgetId:string;
			for (widgetId in this._widgets) {
				if (this._widgets.hasOwnProperty(widgetId)) {
					StyleMutator.setMaxWidth(this._widgets[widgetId].widget.getDomNode(), this._contentWidth);
				}
			}
		});
開發者ID:1424667164,項目名稱:vscode,代碼行數:10,代碼來源:contentWidgets.ts


注:本文中的vs/base/browser/styleMutator.StyleMutator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。