本文整理汇总了TypeScript中vs/editor/browser/editorBrowser.IOverlayWidget类的典型用法代码示例。如果您正苦于以下问题:TypeScript IOverlayWidget类的具体用法?TypeScript IOverlayWidget怎么用?TypeScript IOverlayWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IOverlayWidget类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: addWidget
public addWidget(widget: IOverlayWidget): void {
this._widgets[widget.getId()] = {
widget: widget,
preference: null
};
// This is sync because a widget wants to be in the dom
var domNode = widget.getDomNode();
domNode.style.position = 'absolute';
domNode.setAttribute('widgetId', widget.getId());
this.domNode.appendChild(domNode);
}
示例2: addWidget
public addWidget(widget: IOverlayWidget): void {
const domNode = createFastDomNode(widget.getDomNode());
this._widgets[widget.getId()] = {
widget: widget,
preference: null,
domNode: domNode
};
// This is sync because a widget wants to be in the dom
domNode.setPosition('absolute');
domNode.setAttribute('widgetId', widget.getId());
this._domNode.domNode.appendChild(domNode.domNode);
this.setShouldRender();
}
示例3: removeWidget
public removeWidget(widget: IOverlayWidget): void {
var widgetId = widget.getId();
if (this._widgets.hasOwnProperty(widgetId)) {
var widgetData = this._widgets[widgetId];
var domNode = widgetData.widget.getDomNode();
delete this._widgets[widgetId];
domNode.parentNode.removeChild(domNode);
}
}
示例4: setWidgetPosition
public setWidgetPosition(widget: IOverlayWidget, preference:OverlayWidgetPositionPreference): void {
var widgetData = this._widgets[widget.getId()];
widgetData.preference = preference;
this._requestModificationFrame(() => {
if(this._widgets.hasOwnProperty(widget.getId())) {
this._renderWidget(widgetData);
}
});
}
示例5: setWidgetPosition
public setWidgetPosition(widget: IOverlayWidget, preference: OverlayWidgetPositionPreference): boolean {
let widgetData = this._widgets[widget.getId()];
if (widgetData.preference === preference) {
return false;
}
widgetData.preference = preference;
this.setShouldRender();
return true;
}
示例6: removeWidget
public removeWidget(widget: IOverlayWidget): void {
let widgetId = widget.getId();
if (this._widgets.hasOwnProperty(widgetId)) {
const widgetData = this._widgets[widgetId];
const domNode = widgetData.domNode.domNode;
delete this._widgets[widgetId];
domNode.parentNode.removeChild(domNode);
this.setShouldRender();
}
}
示例7: setWidgetPosition
public setWidgetPosition(widget: IOverlayWidget, preference:OverlayWidgetPositionPreference): boolean {
var widgetData = this._widgets[widget.getId()];
if (widgetData.preference === preference) {
return false;
}
widgetData.preference = preference;
this._requestModificationFrame(() => {
if(this._widgets.hasOwnProperty(widget.getId())) {
this._renderWidget(widgetData);
}
});
return true;
}
示例8:
this._requestModificationFrame(() => {
if(this._widgets.hasOwnProperty(widget.getId())) {
this._renderWidget(widgetData);
}
});