• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript dom.addClass函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中vs/base/browser/dom.addClass函数的典型用法代码示例。如果您正苦于以下问题:TypeScript addClass函数的具体用法?TypeScript addClass怎么用?TypeScript addClass使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了addClass函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: create

	protected create(parent: HTMLElement): void {
		this.titleContainer = parent;
		this.titleContainer.draggable = true;

		//Container listeners
		this.registerContainerListeners();

		// Gesture Support
		Gesture.addTarget(this.titleContainer);

		const labelContainer = document.createElement('div');
		addClass(labelContainer, 'label-container');
		this.titleContainer.appendChild(labelContainer);

		// Editor Label
		this.editorLabel = this._register(this.instantiationService.createInstance(ResourceLabel, labelContainer, void 0));
		this._register(this.editorLabel.onClick(e => this.onTitleLabelClick(e)));

		// Breadcrumbs
		this.createBreadcrumbsControl(labelContainer, { showFileIcons: false, showSymbolIcons: true, showDecorationColors: false, breadcrumbsBackground: editorBackground });
		toggleClass(this.titleContainer, 'breadcrumbs', Boolean(this.breadcrumbsControl));
		this.toDispose.push({ dispose: () => removeClass(this.titleContainer, 'breadcrumbs') }); // import to remove because the container is a shared dom node

		// Right Actions Container
		const actionsContainer = document.createElement('div');
		addClass(actionsContainer, 'title-actions');
		this.titleContainer.appendChild(actionsContainer);

		// Editor actions toolbar
		this.createEditorActionsToolBar(actionsContainer);
	}
开发者ID:developers23,项目名称:vscode,代码行数:31,代码来源:noTabsTitleControl.ts


示例2: create

	protected create(parent: HTMLElement): void {
		this.titleContainer = parent;
		this.titleContainer.draggable = true;

		//Container listeners
		this.registerContainerListeners();

		// Gesture Support
		Gesture.addTarget(this.titleContainer);

		const labelContainer = document.createElement('div');
		addClass(labelContainer, 'label-container');
		this.titleContainer.appendChild(labelContainer);

		// Editor Label
		this.editorLabel = this._register(this.instantiationService.createInstance(ResourceLabel, labelContainer, void 0));
		this._register(this.editorLabel.onClick(e => this.onTitleLabelClick(e)));

		// Breadcrumbs
		this.createBreadcrumbsControl(labelContainer, { showFileIcons: false, showSymbolIcons: true, showDecorationColors: false, extraClasses: ['no-tabs-breadcrumbs'] });

		// Right Actions Container
		const actionsContainer = document.createElement('div');
		addClass(actionsContainer, 'title-actions');
		this.titleContainer.appendChild(actionsContainer);

		// Editor actions toolbar
		this.createEditorActionsToolBar(actionsContainer);
	}
开发者ID:burhandodhy,项目名称:azuredatastudio,代码行数:29,代码来源:noTabsTitleControl.ts


示例3: doSetWorked

	private doSetWorked(value: number): ProgressBar {
		assert.ok(!isNaN(this.totalWork), 'Total work not set');

		this.workedVal = value;
		this.workedVal = Math.min(this.totalWork, this.workedVal);

		if (hasClass(this.element, css_infinite)) {
			removeClass(this.element, css_infinite);
		}

		if (hasClass(this.element, css_done)) {
			removeClass(this.element, css_done);
		}

		if (!hasClass(this.element, css_active)) {
			addClass(this.element, css_active);
		}

		if (!hasClass(this.element, css_discrete)) {
			addClass(this.element, css_discrete);
		}

		this.bit.style.width = 100 * (this.workedVal / this.totalWork) + '%';

		return this;
	}
开发者ID:developers23,项目名称:vscode,代码行数:26,代码来源:progressbar.ts


示例4: doRefresh

	protected doRefresh(): void {
		const group = this.context;
		const editor = group && group.activeEditor;
		if (!editor) {
			this.editorLabel.clear();
			this.clearEditorActionsToolbar();

			return; // return early if we are being closed
		}

		const isPinned = group.isPinned(group.activeEditor);
		const isActive = this.stacks.isActive(group);

		// Activity state
		if (isActive) {
			DOM.addClass(this.titleContainer, 'active');
		} else {
			DOM.removeClass(this.titleContainer, 'active');
		}

		// Dirty state
		if (editor.isDirty()) {
			DOM.addClass(this.titleContainer, 'dirty');
		} else {
			DOM.removeClass(this.titleContainer, 'dirty');
		}

		// Editor Label
		const resource = toResource(editor, { supportSideBySide: true });
		const name = editor.getName() || '';

		const labelFormat = this.editorGroupService.getTabOptions().labelFormat;
		let description: string;
		if (labelFormat === 'default' && !isActive) {
			description = ''; // hide description when group is not active and style is 'default'
		} else {
			description = editor.getDescription(this.getVerbosity(labelFormat)) || '';
		}

		let title = editor.getTitle(Verbosity.LONG);
		if (description === title) {
			title = ''; // dont repeat what is already shown
		}

		this.editorLabel.setLabel({ name, description, resource }, { title, italic: !isPinned, extraClasses: ['title-label'] });
		if (isActive) {
			this.editorLabel.element.style.color = this.getColor(TAB_ACTIVE_FOREGROUND);
		} else {
			this.editorLabel.element.style.color = this.getColor(TAB_UNFOCUSED_ACTIVE_FOREGROUND);
		}

		// Update Editor Actions Toolbar
		this.updateEditorActionsToolbar();
	}
开发者ID:AllureFer,项目名称:vscode,代码行数:54,代码来源:noTabsTitleControl.ts


示例5: create

	private create(container: HTMLElement): void {
		this.element = document.createElement('div');
		addClass(this.element, css_progress_container);
		container.appendChild(this.element);

		this.bit = document.createElement('div');
		addClass(this.bit, css_progress_bit);
		this.element.appendChild(this.bit);

		this.applyStyles();
	}
开发者ID:developers23,项目名称:vscode,代码行数:11,代码来源:progressbar.ts


示例6: addClass

		this.ifEditorIsActive(editor, () => {
			if (editor.isDirty()) {
				addClass(this.titleContainer, 'dirty');
			} else {
				removeClass(this.titleContainer, 'dirty');
			}
		});
开发者ID:developers23,项目名称:vscode,代码行数:7,代码来源:noTabsTitleControl.ts


示例7: release

	/**
	 * Releases the row for eventual reuse. The row's domNode
	 * will eventually be removed from its parent, given that
	 * it is not the currently scrolling row (for OS X ballistic
	 * scrolling).
	 */
	release(row: IRow): void {
		if (!row.domNode) {
			return;
		}

		var lastScrollTime = getLastScrollTime(row.domNode);

		if (!lastScrollTime) {
			removeFromParent(row.domNode);
			this.getTemplateCache(row.templateId).push(row);
			return;
		}

		if (this.scrollingRow) {
			var lastKnownScrollTime = getLastScrollTime(this.scrollingRow.domNode);

			if (lastKnownScrollTime > lastScrollTime) {
				removeFromParent(row.domNode);
				this.getTemplateCache(row.templateId).push(row);
				return;
			}

			if (this.scrollingRow.domNode.parentElement) {
				removeFromParent(this.scrollingRow.domNode);
				removeClass(this.scrollingRow.domNode, 'scrolling');
				this.getTemplateCache(this.scrollingRow.templateId).push(this.scrollingRow);
			}
		}

		this.scrollingRow = row;
		addClass(this.scrollingRow.domNode, 'scrolling');
	}
开发者ID:emiljas,项目名称:vscode,代码行数:38,代码来源:rowCache.ts


示例8: render

	public render(container: HTMLElement): void {
		dom.addClass(container, 'select-container');
		container.appendChild(this.selectElement);
		this.setOptions(this.options, this.selected);

		this.applyStyles();
	}
开发者ID:SeanKilleen,项目名称:vscode,代码行数:7,代码来源:selectBox.ts


示例9: release

	/**
	 * Releases the row for eventual reuse. The row's domNode
	 * will eventually be removed from its parent, given that
	 * it is not the currently scrolling row (for OS X ballistic
	 * scrolling).
	 */
	release(row: IRow): void {
		if (!row) {
			return;
		}

		const lastScrollTime = getLastScrollTime(row.domNode);

		if (!lastScrollTime) {
			this.releaseRow(row);
			return;
		}

		if (this.scrollingRow) {
			const lastKnownScrollTime = getLastScrollTime(this.scrollingRow.domNode);

			if (lastKnownScrollTime > lastScrollTime) {
				this.releaseRow(row);
				return;
			}

			if (this.scrollingRow.domNode.parentElement) {
				this.releaseRow(this.scrollingRow);
			}
		}

		this.scrollingRow = row;
		addClass(this.scrollingRow.domNode, 'scrolling');
	}
开发者ID:StateFarmIns,项目名称:vscode,代码行数:34,代码来源:rowCache.ts


示例10: doDone

	private doDone(delayed: boolean): ProgressBar {
		addClass(this.element, css_done);

		// let it grow to 100% width and hide afterwards
		if (!hasClass(this.element, css_infinite)) {
			this.bit.style.width = 'inherit';

			if (delayed) {
				setTimeout(200, () => this.off());
			} else {
				this.off();
			}
		}

		// let it fade out and hide afterwards
		else {
			this.bit.style.opacity = '0';
			if (delayed) {
				setTimeout(200, () => this.off());
			} else {
				this.off();
			}
		}

		return this;
	}
开发者ID:developers23,项目名称:vscode,代码行数:26,代码来源:progressbar.ts



注:本文中的vs/base/browser/dom.addClass函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript dom.addClasses函数代码示例发布时间:2022-05-25
下一篇:
TypeScript contextmenu.IContextMenuDelegate类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap