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

Commit ed80df7

Browse files
author
Robert Messerle
committed
fix(tabs): fixes tab sizing issues with and without pagination
Closes #4065 Closes #4834 Closes #4873 Must test with #4744
1 parent 83ed1f3 commit ed80df7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/tabs/js/tabsController.js

+8
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,17 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
534534
* Updates whether or not pagination should be displayed.
535535
*/
536536
function updatePagination () {
537+
updatePagingWidth();
538+
ctrl.maxTabWidth = getMaxTabWidth();
537539
ctrl.shouldPaginate = shouldPaginate();
538540
}
539541

542+
function updatePagingWidth() {
543+
var width = 1;
544+
angular.forEach(elements.dummies, function (element) { width += element.offsetWidth; });
545+
angular.element(elements.paging).css('width', width + 'px');
546+
}
547+
540548
function getMaxTabWidth () {
541549
return $element.prop('clientWidth');
542550
}

0 commit comments

Comments
 (0)