本文整理汇总了TypeScript中vs/editor/browser/editorBrowser.IOverlayWidget.getId方法的典型用法代码示例。如果您正苦于以下问题:TypeScript IOverlayWidget.getId方法的具体用法?TypeScript IOverlayWidget.getId怎么用?TypeScript IOverlayWidget.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/editor/browser/editorBrowser.IOverlayWidget
的用法示例。
在下文中一共展示了IOverlayWidget.getId方法的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);
}
});