本文整理匯總了TypeScript中vs/base/browser/styleMutator.StyleMutator.setLeft方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript StyleMutator.setLeft方法的具體用法?TypeScript StyleMutator.setLeft怎麽用?TypeScript StyleMutator.setLeft使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/base/browser/styleMutator.StyleMutator
的用法示例。
在下文中一共展示了StyleMutator.setLeft方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: 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');
}
}
}
}
示例2:
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');
}
}
}
}
});
示例3: _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);
}
}
示例4: render
public render(ctx:EditorBrowser.IRestrictedRenderingContext): void {
if (this._isInViewport) {
StyleMutator.setDisplay(this._domNode, 'block');
StyleMutator.setLeft(this._domNode, this._positionLeft);
StyleMutator.setTop(this._domNode, this._positionTop + ctx.viewportTop - ctx.bigNumbersDelta);
} else {
StyleMutator.setDisplay(this._domNode, 'none');
}
}
示例5: _createCursorDomNode
private _createCursorDomNode(isSecondary: boolean): HTMLElement {
var domNode = document.createElement('div');
domNode.className = 'cursor';
if (isSecondary) {
domNode.className += ' secondary';
}
StyleMutator.setHeight(domNode, this._lineHeight);
StyleMutator.setTop(domNode, 0);
StyleMutator.setLeft(domNode, 0);
domNode.setAttribute('role', 'presentation');
domNode.setAttribute('aria-hidden', 'true');
return domNode;
}
示例6: render
public render(ctx:IRestrictedRenderingContext): void {
if (this._isInViewport) {
let renderContent = this._getRenderedContent();
if (this._lastRenderedContent !== renderContent) {
this._lastRenderedContent = renderContent;
this._domNode.textContent = this._lastRenderedContent;
}
StyleMutator.setDisplay(this._domNode, 'block');
StyleMutator.setLeft(this._domNode, this._positionLeft);
StyleMutator.setTop(this._domNode, this._positionTop + ctx.viewportTop - ctx.bigNumbersDelta);
StyleMutator.setLineHeight(this._domNode, this._lineHeight);
StyleMutator.setHeight(this._domNode, this._lineHeight);
} else {
StyleMutator.setDisplay(this._domNode, 'none');
}
}
示例7: _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);
}