本文整理汇总了TypeScript中vs/base/browser/styleMutator.StyleMutator.setWidth方法的典型用法代码示例。如果您正苦于以下问题:TypeScript StyleMutator.setWidth方法的具体用法?TypeScript StyleMutator.setWidth怎么用?TypeScript StyleMutator.setWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/base/browser/styleMutator.StyleMutator
的用法示例。
在下文中一共展示了StyleMutator.setWidth方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: render
public render(ctx: IRestrictedRenderingContext): void {
let visibleWhitespaces = this._whitespaceManager.getWhitespaceViewportData();
let visibleZones: { [id: string]: editorCommon.IViewWhitespaceViewportData; } = {};
let hasVisibleZone = false;
for (let i = 0, len = visibleWhitespaces.length; i < len; i++) {
visibleZones[visibleWhitespaces[i].id.toString()] = visibleWhitespaces[i];
hasVisibleZone = true;
}
let keys = Object.keys(this._zones);
for (let i = 0, len = keys.length; i < len; i++) {
let id = keys[i];
let zone = this._zones[id];
let newTop = 0;
let newHeight = 0;
let newDisplay = 'none';
if (visibleZones.hasOwnProperty(id)) {
newTop = visibleZones[id].verticalOffset - ctx.bigNumbersDelta;
newHeight = visibleZones[id].height;
newDisplay = 'block';
// zone is visible
if (!zone.isVisible) {
zone.delegate.domNode.setAttribute('monaco-visible-view-zone', 'true');
zone.isVisible = true;
}
this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(visibleZones[id].verticalOffset));
} else {
if (zone.isVisible) {
zone.delegate.domNode.removeAttribute('monaco-visible-view-zone');
zone.isVisible = false;
}
this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(-1000000));
}
StyleMutator.setTop(zone.delegate.domNode, newTop);
StyleMutator.setHeight(zone.delegate.domNode, newHeight);
StyleMutator.setDisplay(zone.delegate.domNode, newDisplay);
if (zone.delegate.marginDomNode) {
StyleMutator.setTop(zone.delegate.marginDomNode, newTop);
StyleMutator.setHeight(zone.delegate.marginDomNode, newHeight);
StyleMutator.setDisplay(zone.delegate.marginDomNode, newDisplay);
}
}
if (hasVisibleZone) {
StyleMutator.setWidth(this.domNode, Math.max(ctx.scrollWidth, this._contentWidth));
StyleMutator.setWidth(this.marginDomNode, this._contentLeft);
}
}
示例2: _updateSlider
protected _updateSlider(sliderSize: number, sliderPosition: number): void {
StyleMutator.setWidth(this.slider, sliderSize);
if (!this._forbidTranslate3dUse && Browser.canUseTranslate3d) {
StyleMutator.setTransform(this.slider, 'translate3d(' + sliderPosition + 'px, 0px, 0px)');
} else {
StyleMutator.setLeft(this.slider, sliderPosition);
}
}
示例3: render
public render(ctx:IRestrictedRenderingContext): void {
StyleMutator.setWidth(this.domNode, this._editorWidth);
let keys = Object.keys(this._widgets);
for (let i = 0, len = keys.length; i < len; i++) {
let widgetId = keys[i];
this._renderWidget(this._widgets[widgetId]);
}
}
示例4: render
public render(ctx: IRestrictedRenderingContext): void {
if (this._canUseTranslate3d) {
let transform = 'translate3d(0px, ' + ctx.linesViewportData.visibleRangesDeltaTop + 'px, 0px)';
StyleMutator.setTransform(this.domNode, transform);
StyleMutator.setTop(this.domNode, 0);
} else {
StyleMutator.setTransform(this.domNode, '');
StyleMutator.setTop(this.domNode, ctx.linesViewportData.visibleRangesDeltaTop);
}
let height = Math.min(this._layoutProvider.getTotalHeight(), 1000000);
StyleMutator.setHeight(this.domNode, height);
StyleMutator.setWidth(this.domNode, this._contentLeft);
this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft);
this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth);
this._glyphMarginBackgroundDomNode.setHeight(height);
}
示例5:
this._requestModificationFrame(() => {
var visibleZones:{[id:string]:editorCommon.IViewWhitespaceViewportData;} = {},
i:number,
len:number,
hasVisibleZone = false;
for (i = 0, len = visibleWhitespaces.length; i < len; i++) {
visibleZones[visibleWhitespaces[i].id.toString()] = visibleWhitespaces[i];
hasVisibleZone = true;
}
var id:string,
zone:IMyViewZone;
for (id in this._zones) {
if (this._zones.hasOwnProperty(id)) {
zone = this._zones[id];
if (visibleZones.hasOwnProperty(id)) {
// zone is visible
StyleMutator.setTop(zone.delegate.domNode, (visibleZones[id].verticalOffset - ctx.bigNumbersDelta));
StyleMutator.setHeight(zone.delegate.domNode, visibleZones[id].height);
if (!zone.isVisible) {
StyleMutator.setDisplay(zone.delegate.domNode, 'block');
zone.delegate.domNode.setAttribute('monaco-visible-view-zone', 'true');
zone.isVisible = true;
}
this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(visibleZones[id].verticalOffset));
} else {
if (zone.isVisible) {
StyleMutator.setDisplay(zone.delegate.domNode, 'none');
zone.delegate.domNode.removeAttribute('monaco-visible-view-zone');
zone.isVisible = false;
}
this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(-1000000));
}
}
}
if (hasVisibleZone) {
StyleMutator.setWidth(this.domNode, ctx.scrollWidth);
}
});
示例6:
this._requestModificationFrame(() => {
StyleMutator.setWidth(this._domNode, this._width);
dom.toggleClass(this._domNode, ClassNames.SCROLL_DECORATION, this._shouldShow);
});
示例7:
this._requestModificationFrame(() => {
StyleMutator.setWidth(this.domNode, layoutInfo.width);
});
示例8: _renderDomNode
protected _renderDomNode(largeSize: number, smallSize: number): void {
StyleMutator.setWidth(this.domNode, largeSize);
StyleMutator.setHeight(this.domNode, smallSize);
StyleMutator.setLeft(this.domNode, 0);
StyleMutator.setBottom(this.domNode, 0);
}
示例9: render
public render(ctx: IRestrictedRenderingContext): void {
StyleMutator.setWidth(this._domNode, this._width);
dom.toggleClass(this._domNode, ClassNames.SCROLL_DECORATION, this._shouldShow);
}