From a441bbeb27e219c96d201c47e181c92eec05577f Mon Sep 17 00:00:00 2001 From: Yuan Gao Date: Tue, 21 Feb 2017 17:28:27 -0800 Subject: [PATCH 1/6] Try to make screenshot image size same as before --- e2e/screenshot.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/screenshot.ts b/e2e/screenshot.ts index f6a2d5af0901..b781ccacf693 100644 --- a/e2e/screenshot.ts +++ b/e2e/screenshot.ts @@ -3,8 +3,8 @@ import * as path from 'path'; import {browser} from 'protractor'; const OUTPUT_DIR = './screenshots/'; -const HEIGHT = 768; -const WIDTH = 1024; +const HEIGHT = 788; +const WIDTH = 1034; let currentJasmineSpecName = ''; From 436547a8c2b3c1f5fafe7c2276d7977e1543bb00 Mon Sep 17 00:00:00 2001 From: Yuan Gao Date: Tue, 21 Feb 2017 17:36:03 -0800 Subject: [PATCH 2/6] change back to 1024 x 768 --- e2e/screenshot.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/screenshot.ts b/e2e/screenshot.ts index b781ccacf693..f6a2d5af0901 100644 --- a/e2e/screenshot.ts +++ b/e2e/screenshot.ts @@ -3,8 +3,8 @@ import * as path from 'path'; import {browser} from 'protractor'; const OUTPUT_DIR = './screenshots/'; -const HEIGHT = 788; -const WIDTH = 1034; +const HEIGHT = 768; +const WIDTH = 1024; let currentJasmineSpecName = ''; From 25b19c1f3f636494ed081c0d1f401b9c9c8574f8 Mon Sep 17 00:00:00 2001 From: Yuan Gao Date: Thu, 13 Apr 2017 13:13:04 -0700 Subject: [PATCH 3/6] Fix disabled checkbox throw error when clicked --- src/lib/checkbox/checkbox.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/checkbox/checkbox.ts b/src/lib/checkbox/checkbox.ts index e7a69a412169..0b08e532107d 100644 --- a/src/lib/checkbox/checkbox.ts +++ b/src/lib/checkbox/checkbox.ts @@ -142,7 +142,10 @@ export class MdCheckbox implements ControlValueAccessor, AfterViewInit, OnDestro /** Whether the checkbox is disabled. */ @Input() get disabled(): boolean { return this._disabled; } - set disabled(value) { this._disabled = coerceBooleanProperty(value); } + set disabled(value) { + this._disabled = coerceBooleanProperty(value); + this._changeDetectorRef.markForCheck(); + } /** Tabindex value that is passed to the underlying input element. */ @Input() tabIndex: number = 0; From ce16234699ec45572c17b4b5a862933b19dfbb33 Mon Sep 17 00:00:00 2001 From: Yuan Gao Date: Thu, 13 Apr 2017 14:14:32 -0700 Subject: [PATCH 4/6] . --- src/lib/checkbox/checkbox.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/checkbox/checkbox.ts b/src/lib/checkbox/checkbox.ts index 0b08e532107d..9a131f0f6a66 100644 --- a/src/lib/checkbox/checkbox.ts +++ b/src/lib/checkbox/checkbox.ts @@ -142,10 +142,7 @@ export class MdCheckbox implements ControlValueAccessor, AfterViewInit, OnDestro /** Whether the checkbox is disabled. */ @Input() get disabled(): boolean { return this._disabled; } - set disabled(value) { - this._disabled = coerceBooleanProperty(value); - this._changeDetectorRef.markForCheck(); - } + set disabled(value) { this._disabled = coerceBooleanProperty(value);} /** Tabindex value that is passed to the underlying input element. */ @Input() tabIndex: number = 0; @@ -307,6 +304,7 @@ export class MdCheckbox implements ControlValueAccessor, AfterViewInit, OnDestro */ setDisabledState(isDisabled: boolean) { this.disabled = isDisabled; + this._changeDetectorRef.markForCheck(); } private _transitionCheckState(newState: TransitionCheckState) { From 4476218b6336851616beeaae4bd38bb5a76f25f1 Mon Sep 17 00:00:00 2001 From: Yuan Gao Date: Thu, 13 Apr 2017 14:52:45 -0700 Subject: [PATCH 5/6] add test --- src/lib/checkbox/checkbox.spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/checkbox/checkbox.spec.ts b/src/lib/checkbox/checkbox.spec.ts index 180a4003fa7a..297307b40e94 100644 --- a/src/lib/checkbox/checkbox.spec.ts +++ b/src/lib/checkbox/checkbox.spec.ts @@ -710,6 +710,7 @@ describe('MdCheckbox', () => { let checkboxDebugElement: DebugElement; let checkboxInstance: MdCheckbox; let testComponent: CheckboxWithFormControl; + let inputElement: HTMLInputElement; beforeEach(() => { fixture = TestBed.createComponent(CheckboxWithFormControl); @@ -718,6 +719,7 @@ describe('MdCheckbox', () => { checkboxDebugElement = fixture.debugElement.query(By.directive(MdCheckbox)); checkboxInstance = checkboxDebugElement.componentInstance; testComponent = fixture.debugElement.componentInstance; + inputElement = checkboxDebugElement.nativeElement.querySelector('input'); }); it('should toggle the disabled state', () => { @@ -727,11 +729,13 @@ describe('MdCheckbox', () => { fixture.detectChanges(); expect(checkboxInstance.disabled).toBe(true); + expect(inputElement.disabled).toBe(true); testComponent.formControl.enable(); fixture.detectChanges(); expect(checkboxInstance.disabled).toBe(false); + expect(inputElement.disabled).toBe(false); }); }); }); From d86ed16743cd476216f6702a74e7ffafaadb4d1b Mon Sep 17 00:00:00 2001 From: Yuan Gao Date: Thu, 13 Apr 2017 14:56:27 -0700 Subject: [PATCH 6/6] fix lint --- src/lib/checkbox/checkbox.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/checkbox/checkbox.ts b/src/lib/checkbox/checkbox.ts index 9a131f0f6a66..ef0d34d5e5ce 100644 --- a/src/lib/checkbox/checkbox.ts +++ b/src/lib/checkbox/checkbox.ts @@ -142,7 +142,7 @@ export class MdCheckbox implements ControlValueAccessor, AfterViewInit, OnDestro /** Whether the checkbox is disabled. */ @Input() get disabled(): boolean { return this._disabled; } - set disabled(value) { this._disabled = coerceBooleanProperty(value);} + set disabled(value) { this._disabled = coerceBooleanProperty(value); } /** Tabindex value that is passed to the underlying input element. */ @Input() tabIndex: number = 0;