Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit aa1e47d

Browse files
author
Robert Messerle
committed
fix(tabs): md-center-tabs should work now
1 parent d52e9c2 commit aa1e47d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/tabs/js/tabsController.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
3232
defineBooleanAttribute('swipeContent');
3333
defineBooleanAttribute('noDisconnect');
3434
defineBooleanAttribute('autoselect');
35-
defineBooleanAttribute('centerTabs');
35+
defineBooleanAttribute('centerTabs', handleCenterTabs);
3636

3737
//-- define public properties
3838
ctrl.scope = $scope;
@@ -153,6 +153,10 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
153153
updateInkBarStyles();
154154
}
155155

156+
function handleCenterTabs (newValue) {
157+
ctrl.shouldCenterTabs = shouldCenterTabs();
158+
}
159+
156160
function handleMaxTabWidth (newWidth, oldWidth) {
157161
if (newWidth !== oldWidth) {
158162
$mdUtil.nextTick(ctrl.updateInkBarStyles);

0 commit comments

Comments
 (0)