Skip to content

Commit f16c8d0

Browse files
committed
Tests and example for tabs
1 parent 3de353e commit f16c8d0

File tree

4 files changed

+117
-43
lines changed

4 files changed

+117
-43
lines changed

dist/bootstrap-decorator.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/bootstrap-example.html

+45-38
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ <h3>Schema</h3>
4949
<script type="text/javascript" src="../bower_components/tv4/tv4.js"></script>
5050
<script type="text/javascript" src="../bower_components/ace-builds/src-min-noconflict/ace.js"></script>
5151
<script type="text/javascript" src="../bower_components/angular/angular.min.js"></script>
52+
<script type="text/javascript" src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
5253
<script type="text/javascript" src="../bower_components/angular-ui-ace/ui-ace.js"></script>
5354
<script type="text/javascript" src="../bower_components/pickadate/lib/picker.js"></script>
5455
<script type="text/javascript" src="../bower_components/pickadate/lib/picker.date.js"></script>
@@ -143,50 +144,56 @@ <h3>Schema</h3>
143144

144145
$scope.form = [
145146
{
146-
type: "help",
147-
helpvalue: "<h1>Yo ninja!</h1>"
148-
},
149-
{
150-
type: "tabs",
151-
tabs: [
152-
{
153-
name: "Simple stuff",
154-
items: [
155-
{
156-
key: "name",
157-
placeholder: "Check the console",
158-
onChange: "log(modelValue)",
159-
feedback: "{'glyphicon': true, 'glyphicon-ok': hasSuccess(), 'glyphicon-star': !hasSuccess() }"
160-
},
161-
{
162-
key: "favorite",
163-
feedback: false
164-
}
165-
]
166-
},
167-
{
168-
name: "More stuff",
169-
items: [
170-
"attributes",
147+
type: "fieldset",
148+
title: "Stuff",
149+
items: [
150+
{
151+
type: "tabs",
152+
tabs: [
171153
{
172-
key: "shoesize",
173-
feedback: false
154+
title: "Simple stuff",
155+
items: [
156+
{
157+
key: "name",
158+
placeholder: "Check the console",
159+
onChange: "log(modelValue)",
160+
feedback: "{'glyphicon': true, 'glyphicon-ok': hasSuccess(), 'glyphicon-star': !hasSuccess() }"
161+
},
162+
{
163+
key: "favorite",
164+
feedback: false
165+
}
166+
]
174167
},
175-
"things",
176-
"soul",
177168
{
178-
type: "conditional",
179-
condition: "person.soul",
169+
title: "More stuff",
180170
items: [
181-
{ key: "soulserial", placeholder: "ex. 666" }
171+
"attributes",
172+
{
173+
key: "shoesize",
174+
feedback: false
175+
},
176+
"things"
182177
]
183-
},
184-
{ key: "date", minDate: "2014-06-20" },
185-
{ key: "radio", type: "radios" },
186-
{ key: "radiobuttons", type: "radiobuttons" }
187-
]
188-
}]
178+
}]
179+
},
180+
]
181+
},
182+
{
183+
type: "help",
184+
helpvalue: "<hr>"
185+
},
186+
"soul",
187+
{
188+
type: "conditional",
189+
condition: "person.soul",
190+
items: [
191+
{ key: "soulserial", placeholder: "ex. 666" }
192+
]
189193
},
194+
{ key: "date", minDate: "2014-06-20" },
195+
{ key: "radio", type: "radios" },
196+
{ key: "radiobuttons", type: "radiobuttons" },
190197
{
191198
type: 'actions',
192199
items: [

src/directives/decorators/bootstrap/tabs.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<div ng-init="selected = { tab: 0 }">
2-
<ul class="nav nav-tabs">
2+
<ul class="nav nav-tabs" style="margin-bottom: 15px">
33
<li ng-repeat="tab in form.tabs"
44
ng-click="selected.tab = $index"
55
ng-class="{active: selected.tab === $index}">
6-
<a>{{ tab.name }}</a>
6+
<a href="#">{{ tab.title }}</a>
77
</li>
88
</ul>
99

10-
<!-- Tab panes -->
1110
<div class="tab-content">
1211
<div class="tab-pane"
1312
ng-repeat="tab in form.tabs"

0 commit comments

Comments
 (0)