Skip to content

Commit

Permalink
feat(md-tabs): add fixed tab mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanood committed Nov 20, 2016
1 parent bb4c12a commit 40f6ba6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/tabs/tabs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { customAttribute } from 'aurelia-templating';
import { bindable, customAttribute } from 'aurelia-templating';
import { inject } from 'aurelia-dependency-injection';
import { TaskQueue } from 'aurelia-task-queue';
import { fireMaterializeEvent } from '../common/events';
Expand All @@ -7,6 +7,8 @@ import { AttributeManager } from '../common/attributeManager';
@customAttribute('md-tabs')
@inject(Element, TaskQueue)
export class MdTabs {
@bindable() fixed = false;

constructor(element, taskQueue) {
this.element = element;
this.taskQueue = taskQueue;
Expand Down Expand Up @@ -49,6 +51,14 @@ export class MdTabs {
});
}

fixedChanged(newValue) {
if (newValue) {
this.attributeManager.addClasses('tabs-fixed-width');
} else {
this.attributeManager.addClasses('tabs-fixed-width');
}
}

fireTabSelectedEvent(e) {
// fix Materialize tab indicator (see: https://github.com/Dogfalo/materialize/pull/2809)
// happens only when the indicator animation is finished
Expand Down

0 comments on commit 40f6ba6

Please sign in to comment.