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


TypeScript StyleMutator.setTop方法代碼示例

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


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

示例1: render

	public render(ctx: IRestrictedRenderingContext): void {
		let visibleWhitespaces = this._whitespaceManager.getWhitespaceViewportData();
		let visibleZones: { [id: string]: editorCommon.IViewWhitespaceViewportData; } = {};

		let hasVisibleZone = false;
		for (let i = 0, len = visibleWhitespaces.length; i < len; i++) {
			visibleZones[visibleWhitespaces[i].id.toString()] = visibleWhitespaces[i];
			hasVisibleZone = true;
		}

		let keys = Object.keys(this._zones);
		for (let i = 0, len = keys.length; i < len; i++) {
			let id = keys[i];
			let zone = this._zones[id];

			let newTop = 0;
			let newHeight = 0;
			let newDisplay = 'none';
			if (visibleZones.hasOwnProperty(id)) {
				newTop = visibleZones[id].verticalOffset - ctx.bigNumbersDelta;
				newHeight = visibleZones[id].height;
				newDisplay = 'block';
				// zone is visible
				if (!zone.isVisible) {
					zone.delegate.domNode.setAttribute('monaco-visible-view-zone', 'true');
					zone.isVisible = true;
				}
				this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(visibleZones[id].verticalOffset));
			} else {
				if (zone.isVisible) {
					zone.delegate.domNode.removeAttribute('monaco-visible-view-zone');
					zone.isVisible = false;
				}
				this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(-1000000));
			}
			StyleMutator.setTop(zone.delegate.domNode, newTop);
			StyleMutator.setHeight(zone.delegate.domNode, newHeight);
			StyleMutator.setDisplay(zone.delegate.domNode, newDisplay);

			if (zone.delegate.marginDomNode) {
				StyleMutator.setTop(zone.delegate.marginDomNode, newTop);
				StyleMutator.setHeight(zone.delegate.marginDomNode, newHeight);
				StyleMutator.setDisplay(zone.delegate.marginDomNode, newDisplay);
			}
		}

		if (hasVisibleZone) {
			StyleMutator.setWidth(this.domNode, Math.max(ctx.scrollWidth, this._contentWidth));
			StyleMutator.setWidth(this.marginDomNode, this._contentLeft);
		}
	}
開發者ID:StateFarmIns,項目名稱:vscode,代碼行數:51,代碼來源:viewZones.ts

示例2: _updateSlider

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

示例3: render

	public render(ctx: IRestrictedRenderingContext): void {
		if (this._canUseTranslate3d) {
			let transform = 'translate3d(0px, ' + ctx.linesViewportData.visibleRangesDeltaTop + 'px, 0px)';
			StyleMutator.setTransform(this.domNode, transform);
			StyleMutator.setTop(this.domNode, 0);
		} else {
			StyleMutator.setTransform(this.domNode, '');
			StyleMutator.setTop(this.domNode, ctx.linesViewportData.visibleRangesDeltaTop);
		}

		let height = Math.min(this._layoutProvider.getTotalHeight(), 1000000);
		StyleMutator.setHeight(this.domNode, height);
		StyleMutator.setWidth(this.domNode, this._contentLeft);

		this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft);
		this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth);
		this._glyphMarginBackgroundDomNode.setHeight(height);
	}
開發者ID:StateFarmIns,項目名稱:vscode,代碼行數:18,代碼來源:margin.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: _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

示例6: render

	public render(ctx:IRestrictedRenderingContext): void {
		if (this._isInViewport) {
			let renderContent = this._getRenderedContent();
			if (this._lastRenderedContent !== renderContent) {
				this._lastRenderedContent = renderContent;
				this._domNode.textContent = this._lastRenderedContent;
			}

			StyleMutator.setDisplay(this._domNode, 'block');
			StyleMutator.setLeft(this._domNode, this._positionLeft);
			StyleMutator.setTop(this._domNode, this._positionTop + ctx.viewportTop - ctx.bigNumbersDelta);
			StyleMutator.setLineHeight(this._domNode, this._lineHeight);
			StyleMutator.setHeight(this._domNode, this._lineHeight);
		} else {
			StyleMutator.setDisplay(this._domNode, 'none');
		}
	}
開發者ID:1833183060,項目名稱:vscode,代碼行數:17,代碼來源:viewCursor.ts

示例7:

		this._requestModificationFrame(() => {
			var visibleZones:{[id:string]:editorCommon.IViewWhitespaceViewportData;} = {},
				i:number,
				len:number,
				hasVisibleZone = false;

			for (i = 0, len = visibleWhitespaces.length; i < len; i++) {
				visibleZones[visibleWhitespaces[i].id.toString()] = visibleWhitespaces[i];
				hasVisibleZone = true;
			}

			var id:string,
				zone:IMyViewZone;

			for (id in this._zones) {
				if (this._zones.hasOwnProperty(id)) {
					zone = this._zones[id];

					if (visibleZones.hasOwnProperty(id)) {
						// zone is visible
						StyleMutator.setTop(zone.delegate.domNode, (visibleZones[id].verticalOffset - ctx.bigNumbersDelta));
						StyleMutator.setHeight(zone.delegate.domNode, visibleZones[id].height);
						if (!zone.isVisible) {
							StyleMutator.setDisplay(zone.delegate.domNode, 'block');
							zone.delegate.domNode.setAttribute('monaco-visible-view-zone', 'true');
							zone.isVisible = true;
						}
						this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(visibleZones[id].verticalOffset));
					} else {
						if (zone.isVisible) {
							StyleMutator.setDisplay(zone.delegate.domNode, 'none');
							zone.delegate.domNode.removeAttribute('monaco-visible-view-zone');
							zone.isVisible = false;
						}
						this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(-1000000));
					}
				}
			}

			if (hasVisibleZone) {
				StyleMutator.setWidth(this.domNode, ctx.scrollWidth);
			}
		});
開發者ID:1424667164,項目名稱:vscode,代碼行數:43,代碼來源:viewZones.ts

示例8: _renderDomNode

	protected _renderDomNode(largeSize: number, smallSize: number): void {
		StyleMutator.setWidth(this.domNode, smallSize);
		StyleMutator.setHeight(this.domNode, largeSize);
		StyleMutator.setRight(this.domNode, 0);
		StyleMutator.setTop(this.domNode, 0);
	}
開發者ID:amamut,項目名稱:vscode,代碼行數:6,代碼來源:verticalScrollbar.ts


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