本文整理汇总了TypeScript中vs/base/browser/styleMutator.StyleMutator.setVisibility方法的典型用法代码示例。如果您正苦于以下问题:TypeScript StyleMutator.setVisibility方法的具体用法?TypeScript StyleMutator.setVisibility怎么用?TypeScript StyleMutator.setVisibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/base/browser/styleMutator.StyleMutator
的用法示例。
在下文中一共展示了StyleMutator.setVisibility方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
this._requestModificationFrame(() => {
let widgetId:string,
widget:IWidgetData,
domNode: HTMLElement;
for (widgetId in this._widgets) {
if (this._widgets.hasOwnProperty(widgetId)) {
widget = this._widgets[widgetId];
domNode = this._widgets[widgetId].widget.getDomNode();
if (data.hasOwnProperty(widgetId)) {
if (widget.allowEditorOverflow) {
StyleMutator.setTop(domNode, data[widgetId].top);
StyleMutator.setLeft(domNode, data[widgetId].left);
} else {
StyleMutator.setTop(domNode, data[widgetId].top + ctx.viewportTop - ctx.bigNumbersDelta);
StyleMutator.setLeft(domNode, data[widgetId].left);
}
if (!widget.isVisible) {
StyleMutator.setVisibility(domNode, 'inherit');
domNode.setAttribute('monaco-visible-content-widget', 'true');
widget.isVisible = true;
}
} else {
if (widget.isVisible) {
domNode.removeAttribute('monaco-visible-content-widget');
widget.isVisible = false;
StyleMutator.setVisibility(domNode, 'hidden');
}
}
}
}
});
示例2: render
public render(ctx:IRestrictedRenderingContext): void {
let data = this._renderData;
let keys = Object.keys(this._widgets);
for (let i = 0, len = keys.length; i < len; i++) {
let widgetId = keys[i];
let widget = this._widgets[widgetId];
let domNode = this._widgets[widgetId].widget.getDomNode();
if (data.hasOwnProperty(widgetId)) {
if (widget.allowEditorOverflow) {
StyleMutator.setTop(domNode, data[widgetId].top);
StyleMutator.setLeft(domNode, data[widgetId].left);
} else {
StyleMutator.setTop(domNode, data[widgetId].top + ctx.viewportTop - ctx.bigNumbersDelta);
StyleMutator.setLeft(domNode, data[widgetId].left);
}
if (!widget.isVisible) {
StyleMutator.setVisibility(domNode, 'inherit');
domNode.setAttribute('monaco-visible-content-widget', 'true');
widget.isVisible = true;
}
} else {
if (widget.isVisible) {
domNode.removeAttribute('monaco-visible-content-widget');
widget.isVisible = false;
StyleMutator.setVisibility(domNode, 'hidden');
}
}
}
}
示例3: addWidget
public addWidget(widget: IContentWidget): void {
let widgetData: IWidgetData = {
allowEditorOverflow: widget.allowEditorOverflow || false,
widget: widget,
position: null,
preference: null,
isVisible: false
};
this._widgets[widget.getId()] = widgetData;
let domNode = widget.getDomNode();
domNode.style.position = 'absolute';
StyleMutator.setMaxWidth(domNode, this._contentWidth);
StyleMutator.setVisibility(domNode, 'hidden');
domNode.setAttribute('widgetId', widget.getId());
if (widgetData.allowEditorOverflow) {
this.overflowingContentWidgetsDomNode.appendChild(domNode);
} else {
this.domNode.appendChild(domNode);
}
this.shouldRender = true;
}
示例4: hide
public hide(): void {
if (this._isVisible) {
StyleMutator.setVisibility(this._domNode, 'hidden');
this._isVisible = false;
}
}
示例5: show
public show(): void {
if (!this._isVisible) {
StyleMutator.setVisibility(this._domNode, 'inherit');
this._isVisible = true;
}
}