提交 192682d2 编写于 作者: M Matt Bierner

Remove builder border methods

Only used in tests
上级 3f99a49f
......@@ -1039,121 +1039,6 @@ export class Builder implements IDisposable {
}
}
/**
* Sets the CSS property border.
*/
public border(border: string): Builder;
public border(width: number, style?: string, color?: string): Builder;
public border(width: any, style?: string, color?: string): Builder {
if (types.isString(width) && width.indexOf(' ') >= 0) {
return this.border.apply(this, width.split(' '));
}
this.currentElement.style.borderWidth = this.toPixel(width);
if (color) {
this.currentElement.style.borderColor = color;
}
if (style) {
this.currentElement.style.borderStyle = style;
}
return this;
}
/**
* Sets the CSS property border-top.
*/
public borderTop(border: string): Builder;
public borderTop(width: number, style: string, color: string): Builder;
public borderTop(width: any, style?: string, color?: string): Builder {
if (types.isString(width) && width.indexOf(' ') >= 0) {
return this.borderTop.apply(this, width.split(' '));
}
this.currentElement.style.borderTopWidth = this.toPixel(width);
if (color) {
this.currentElement.style.borderTopColor = color;
}
if (style) {
this.currentElement.style.borderTopStyle = style;
}
return this;
}
/**
* Sets the CSS property border-bottom.
*/
public borderBottom(border: string): Builder;
public borderBottom(width: number, style: string, color: string): Builder;
public borderBottom(width: any, style?: string, color?: string): Builder {
if (types.isString(width) && width.indexOf(' ') >= 0) {
return this.borderBottom.apply(this, width.split(' '));
}
this.currentElement.style.borderBottomWidth = this.toPixel(width);
if (color) {
this.currentElement.style.borderBottomColor = color;
}
if (style) {
this.currentElement.style.borderBottomStyle = style;
}
return this;
}
/**
* Sets the CSS property border-left.
*/
public borderLeft(border: string): Builder;
public borderLeft(width: number, style: string, color: string): Builder;
public borderLeft(width: any, style?: string, color?: string): Builder {
if (types.isString(width) && width.indexOf(' ') >= 0) {
return this.borderLeft.apply(this, width.split(' '));
}
this.currentElement.style.borderLeftWidth = this.toPixel(width);
if (color) {
this.currentElement.style.borderLeftColor = color;
}
if (style) {
this.currentElement.style.borderLeftStyle = style;
}
return this;
}
/**
* Sets the CSS property border-right.
*/
public borderRight(border: string): Builder;
public borderRight(width: number, style: string, color: string): Builder;
public borderRight(width: any, style?: string, color?: string): Builder {
if (types.isString(width) && width.indexOf(' ') >= 0) {
return this.borderRight.apply(this, width.split(' '));
}
this.currentElement.style.borderRightWidth = this.toPixel(width);
if (color) {
this.currentElement.style.borderRightColor = color;
}
if (style) {
this.currentElement.style.borderRightStyle = style;
}
return this;
}
private toPixel(obj: any): string {
if (obj.toString().indexOf('px') === -1) {
return obj.toString() + 'px';
......
......@@ -664,41 +664,6 @@ suite('Builder', () => {
});
});
test('Builder.border(), .borderTop(), .borderBottom(), .borderLeft(), .borderRight()', function () {
let b = Build.withElementById(fixtureId);
b.div();
b.border('1px solid red');
assert.strictEqual(b.style('border-width'), '1px');
assert.strictEqual(b.style('border-color'), 'red');
assert.strictEqual(b.style('border-style'), 'solid');
b.borderTop('2px dotted yellow');
assert.strictEqual(b.style('border-top-width'), '2px');
assert.strictEqual(b.style('border-top-color'), 'yellow');
assert.strictEqual(b.style('border-top-style'), 'dotted');
b.borderRight('3px dashed green');
assert.strictEqual(b.style('border-right-width'), '3px');
assert.strictEqual(b.style('border-right-color'), 'green');
assert.strictEqual(b.style('border-right-style'), 'dashed');
b.borderBottom('4px solid blue');
assert.strictEqual(b.style('border-bottom-width'), '4px');
assert.strictEqual(b.style('border-bottom-color'), 'blue');
assert.strictEqual(b.style('border-bottom-style'), 'solid');
b.borderLeft('5px dashed white');
assert.strictEqual(b.style('border-left-width'), '5px');
assert.strictEqual(b.style('border-left-color'), 'white');
assert.strictEqual(b.style('border-left-style'), 'dashed');
});
test('Builder.innerHtml()', function () {
let b = Build.withElementById(fixtureId);
b.div();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册