Skip to content

Commit d0ddad1

Browse files
author
Robert Messerle
committed
feat(tabs): adds support for md-no-pagination
Closes angular#1189
1 parent 2de0cf2 commit d0ddad1

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/components/tabs/js/tabsController.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@
257257
}
258258

259259
function shouldPaginate () {
260+
if ($scope.noPagination) return false;
260261
var canvasWidth = $element.prop('clientWidth');
261262
angular.forEach(elements.tabs, function (tab) { canvasWidth -= tab.offsetWidth; });
262263
return canvasWidth < 0;

src/components/tabs/js/tabsDirective.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
* @param {string=} md-stretch-tabs Attribute to indicate whether or not to stretch tabs: `auto`, `always`, or `never`; default is `auto`
5959
* @param {boolean=} md-dynamic-height When enabled, the tab wrapper will resize based on the contents of the selected tab
6060
* @param {boolean=} md-center-tabs When enabled, tabs will be centered provided there is no need for pagination
61+
* @param {boolean=} md-no-pagination When enabled, pagination will remain off
6162
*
6263
* @usage
6364
* <hljs lang="html">
@@ -91,6 +92,7 @@
9192
function MdTabs ($mdTheming) {
9293
return {
9394
scope: {
95+
noPagination: '=?mdNoPagination',
9496
dynamicHeight: '=?mdDynamicHeight',
9597
centerTabs: '=?mdCenterTabs',
9698
selectedIndex: '=?mdSelected',

0 commit comments

Comments
 (0)