Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit aaa8d81

Browse files
tabs orientation wip
1 parent 4629071 commit aaa8d81

File tree

4 files changed

+29
-9
lines changed

4 files changed

+29
-9
lines changed

Diff for: src/tabs/docs/demo.html

+18-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
<div ng-controller="TabsDemoCtrl">
2+
<h3>Basic tabs</h3>
23
<tabs>
3-
<pane heading="Static title">Static content</pane>
4-
<pane ng-repeat="pane in panes" heading="{{pane.title}}" active="pane.active">{{pane.content}}</pane>
4+
<pane heading="Static title" style="padding-bottom: 9px; border-bottom: 1px solid #ddd;">
5+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin lacinia, ante sit amet pharetra vulputate, augue velit dignissim libero, in blandit neque sapien at sapien. Sed lacinia tellus quis risus consectetur egestas. In hac habitasse platea dictumst.
6+
</pane>
7+
<pane ng-repeat="pane in panes" heading="{{pane.title}}" active="pane.active" style="padding-bottom: 9px; border-bottom: 1px solid #ddd;">{{pane.content}}</pane>
8+
</tabs>
9+
<p>
10+
<button class="btn btn-mini" ng-click="panes[0].active = true">Select second tab</button>
11+
<button class="btn btn-mini" ng-click="panes[1].active = true">Select third tab</button>
12+
</p>
13+
<h3>Different tab placements</h3>
14+
<h4>Left</h4>
15+
<tabs placement="left">
16+
<pane ng-repeat="pane in panes" heading="{{pane.title}}">{{pane.content}}</pane>
17+
</tabs>
18+
<h4>Right</h4>
19+
<tabs placement="right">
20+
<pane ng-repeat="pane in panes" heading="{{pane.title}}">{{pane.content}}</pane>
521
</tabs>
6-
<div class="row-fluid">
7-
<button class="btn" ng-click="panes[0].active = true">Select second tab</button>
8-
<button class="btn" ng-click="panes[1].active = true">Select third tab</button>
9-
</div>
1022
</div>

Diff for: src/tabs/docs/readme.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
AngularJS version of the tabs directive.
1+
AngularJS version of the tabs directive.
2+
3+
Individual tabs can be created statically, from markup, or generated from model using the `ng-repeat directive`.
4+
5+
Tabs selection can be driven by mouse `click` event or in response to model changes (see the `active` attribute).
6+
7+
It is also possible to change placement of tabs using the `placement` attribute.

Diff for: src/tabs/tabs.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ angular.module('ui.bootstrap.tabs', [])
2929
return {
3030
restrict: 'EA',
3131
transclude: true,
32-
scope: {},
32+
scope: {
33+
placement: '@'
34+
},
3335
controller: 'TabsController',
3436
templateUrl: 'template/tabs/tabs.html',
3537
replace: true

Diff for: template/tabs/tabs.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="tabbable">
1+
<div class="tabbable" ng-class='placement && "tabs-" + placement'>
22
<ul class="nav nav-tabs">
33
<li ng-repeat="pane in panes" ng-class="{active:pane.selected}">
44
<a href="" ng-click="select(pane)">{{pane.heading}}</a>

0 commit comments

Comments
 (0)