Skip to content

refactor(expansion panel): fix spell check on some words #5659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/lib/expansion/_expansion-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
border-top-color: mat-color($foreground, divider);
}

.mat-expansion-panel-header:focus,
.mat-expansion-panel-header:focus,
.mat-expansion-panel-header:hover {
background: mat-color($background, hover);
}

.mat-expansion-panel-header-title {
color: mat-color($foreground, text);
}
Expand All @@ -29,4 +30,4 @@
.mat-expansion-indicator::after {
color: mat-color($foreground, secondary-text);
}
}
}
30 changes: 15 additions & 15 deletions src/lib/expansion/accordion-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ let nextId = 0;
*/
@Injectable()
export class AccordionItem implements OnDestroy {
/** Event emitted every time the MdAccordianChild is closed. */
/** Event emitted every time the MdAccordionChild is closed. */
@Output() closed = new EventEmitter<void>();
/** Event emitted every time the MdAccordianChild is opened. */
/** Event emitted every time the MdAccordionChild is opened. */
@Output() opened = new EventEmitter<void>();
/** Event emitted when the MdAccordianChild is destroyed. */
/** Event emitted when the MdAccordionChild is destroyed. */
@Output() destroyed = new EventEmitter<void>();
/** The unique MdAccordianChild id. */
/** The unique MdAccordionChild id. */
readonly id = `cdk-accordion-child-${nextId++}`;
/** Whether the MdAccordianChild is expanded. */
/** Whether the MdAccordionChild is expanded. */
@Input() get expanded(): boolean { return this._expanded; }
set expanded(expanded: boolean) {
// Only emit events and update the internal value if the value changes.
Expand All @@ -44,10 +44,10 @@ export class AccordionItem implements OnDestroy {
if (expanded) {
this.opened.emit();
/**
* In the unique selection dispatcher, the id parameter is the id of the CdkAccordonItem,
* In the unique selection dispatcher, the id parameter is the id of the CdkAccordionItem,
* the name value is the id of the accordion.
*/
let accordionId = this.accordion ? this.accordion.id : this.id;
const accordionId = this.accordion ? this.accordion.id : this.id;
this._expansionDispatcher.notify(this.id, accordionId);
} else {
this.closed.emit();
Expand All @@ -66,14 +66,14 @@ export class AccordionItem implements OnDestroy {
constructor(@Optional() public accordion: CdkAccordion,
private _changeDetectorRef: ChangeDetectorRef,
protected _expansionDispatcher: UniqueSelectionDispatcher) {
this._removeUniqueSelectionListener =
_expansionDispatcher.listen((id: string, accordionId: string) => {
if (this.accordion && !this.accordion.multi &&
this.accordion.id === accordionId && this.id !== id) {
this.expanded = false;
}
});
}
this._removeUniqueSelectionListener =
_expansionDispatcher.listen((id: string, accordionId: string) => {
if (this.accordion && !this.accordion.multi &&
this.accordion.id === accordionId && this.id !== id) {
this.expanded = false;
}
});
}

/** Emits an event for the accordion item being destroyed. */
ngOnDestroy() {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/expansion/accordion.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe('CdkAccordion', () => {
}));

it('should ensure only one item is expanded at a time', () => {
let fixture = TestBed.createComponent(SetOfItems);
let items = fixture.debugElement.queryAll(By.css('.mat-expansion-panel'));
const fixture = TestBed.createComponent(SetOfItems);
const items = fixture.debugElement.queryAll(By.css('.mat-expansion-panel'));

fixture.componentInstance.firstPanelExpanded = true;
fixture.detectChanges();
Expand All @@ -35,8 +35,8 @@ describe('CdkAccordion', () => {
});

it('should allow multiple items to be expanded simultaneously', () => {
let fixture = TestBed.createComponent(SetOfItems);
let panels = fixture.debugElement.queryAll(By.css('.mat-expansion-panel'));
const fixture = TestBed.createComponent(SetOfItems);
const panels = fixture.debugElement.queryAll(By.css('.mat-expansion-panel'));

fixture.componentInstance.multi = true;
fixture.componentInstance.firstPanelExpanded = true;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/expansion/expansion-panel-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<ng-content select="md-panel-description, mat-panel-description"></ng-content>
<ng-content></ng-content>
</span>
<span [@indicatorRotate]="_getExpandedState()" *ngIf="!_getHideToggle()"
class="mat-expansion-indicator"></span>
<span [@indicatorRotate]="_getExpandedState()" *ngIf="!_getHideToggle()"
class="mat-expansion-indicator"></span>
4 changes: 2 additions & 2 deletions src/lib/expansion/expansion-panel-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $mat-expansion-panel-header-height-expanded: 64px;
line-height: $mat-expansion-panel-header-height-expanded;
}

&:focus,
&:focus,
&:hover {
outline: none;
}
Expand Down Expand Up @@ -46,7 +46,7 @@ $mat-expansion-panel-header-height-expanded: 64px;
margin-right: 16px;
}

/**
/**
* Creates the expansion indicator arrow. Done using ::after rather than having
* additional nodes in the template.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/lib/expansion/expansion-panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
<ng-content></ng-content>
</div>
<ng-content select="mat-action-row, md-action-row"></ng-content>
</div>
</div>
2 changes: 1 addition & 1 deletion src/lib/expansion/expansion-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
button.mat-button {
margin-left: 8px;
}
}
}
2 changes: 1 addition & 1 deletion src/lib/expansion/expansion.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('MdExpansionPanel', () => {
TestBed.compileComponents();
}));

it('should expanded and collapse the panel', () => {
it('should expand and collapse the panel', () => {
const fixture = TestBed.createComponent(PanelWithContent);
const contentEl = fixture.debugElement.query(By.css('.mat-expansion-panel-content'));
const headerEl = fixture.debugElement.query(By.css('.mat-expansion-panel-header'));
Expand Down