本文整理汇总了TypeScript中vs/base/browser/styleMutator.StyleMutator.setMaxWidth方法的典型用法代码示例。如果您正苦于以下问题:TypeScript StyleMutator.setMaxWidth方法的具体用法?TypeScript StyleMutator.setMaxWidth怎么用?TypeScript StyleMutator.setMaxWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/base/browser/styleMutator.StyleMutator
的用法示例。
在下文中一共展示了StyleMutator.setMaxWidth方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
this._requestModificationFrameBeforeRendering(() => {
// update the maxWidth on widgets nodes, such that `onReadAfterForcedLayout`
// below can read out the adjusted width/height of widgets
let widgetId:string;
for (widgetId in this._widgets) {
if (this._widgets.hasOwnProperty(widgetId)) {
StyleMutator.setMaxWidth(this._widgets[widgetId].widget.getDomNode(), this._contentWidth);
}
}
});
示例2: onLayoutChanged
public onLayoutChanged(layoutInfo:editorCommon.EditorLayoutInfo): boolean {
this._contentLeft = layoutInfo.contentLeft;
if (this._contentWidth !== layoutInfo.contentWidth) {
this._contentWidth = layoutInfo.contentWidth;
// update the maxWidth on widgets nodes, such that `onReadAfterForcedLayout`
// below can read out the adjusted width/height of widgets
let keys = Object.keys(this._widgets);
for (let i = 0, len = keys.length; i < len; i++) {
let widgetId = keys[i];
StyleMutator.setMaxWidth(this._widgets[widgetId].widget.getDomNode(), this._contentWidth);
}
}
return true;
}
示例3: onLayoutChanged
public onLayoutChanged(layoutInfo: editorCommon.EditorLayoutInfo): boolean {
this._contentLeft = layoutInfo.contentLeft;
if (this._contentWidth !== layoutInfo.contentWidth) {
this._contentWidth = layoutInfo.contentWidth;
// update the maxWidth on widgets nodes, such that `onReadAfterForcedLayout`
// below can read out the adjusted width/height of widgets
let keys = Object.keys(this._widgets);
for (let i = 0, len = keys.length; i < len; i++) {
const widgetId = keys[i];
const widgetData = this._widgets[widgetId];
const widget = widgetData.widget;
const maxWidth = widgetData.allowEditorOverflow
? window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
: this._contentWidth;
StyleMutator.setMaxWidth(widget.getDomNode(), maxWidth);
}
}
return true;
}
示例4: 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;
}