Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tab array: sortable tabs, hide add and remove #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Anthropic merged 6 commits into json-schema-form:develop from joelwkent:develop
May 29, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Example and tests include hiding Add and Remove
The example has been extended to include 4 tab array demos:
standard, add link disabled, remove button disabled and
drag and drop sortable. The protractor tests have been extended to
test add link disabled and remove button disabled.
  • Loading branch information
joelwkent committed Apr 27, 2016
commit a24eebc44dc5f8dad3e933da7d1b26f1d76e7d6c
68 changes: 0 additions & 68 deletions examples/sortable-tabarray.html
View file Open in desktop

This file was deleted.

202 changes: 202 additions & 0 deletions examples/tabarray.html
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Tab Array Demo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">

<link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="../bower_components/bootstrap-vertical-tabs/bootstrap.vertical-tabs.min.css">

<script type="text/javascript" src="../bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="../bower_components/angular/angular.min.js"></script>
<script type="text/javascript" src="../bower_components/angular-sanitize/angular-sanitize.min.js"></script>
<script type="text/javascript" src="../bower_components/tv4/tv4.js"></script>
<script type="text/javascript" src="../bower_components/objectpath/lib/ObjectPath.js"></script>
<script type="text/javascript" src="../bower_components/angular-schema-form/dist/schema-form.js"></script>
<script type="text/javascript" src="../bootstrap-decorator.js"></script>
<script type="text/javascript" src="../bower_components/angular-ui-sortable/sortable.min.js"></script>
<script type="text/javascript" src="../bower_components/jquery-ui/jquery-ui.min.js"></script>

<script type="text/javascript">
var exampleApp = angular.module('exampleApp',['schemaForm', 'ui.sortable']);

exampleApp.controller('exampleCtrl', ['$scope', function($scope) {

$scope.model = {
"exampleSelector": "standard"
};

$scope.schema = {
"type": "object",
"properties": {
"exampleSelector": {
"type": "string",
"title": "Tab Array Example Selector",
"enum": [
"standard",
"addDisabled",
"removeDisabled",
"sortable"
]
},
"standardTabArray": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"nick": { "type": "string" }
}
}
},
"addDisabledTabArray": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"nick": { "type": "string" }
}
}
},
"removeDisabledTabArray": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"nick": { "type": "string" }
}
}
},
"sortableTabArray": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"nick": { "type": "string" }
}
}
}
}
};

$scope.form = [
{
"key": "exampleSelector",
"titleMap": [
{"value": "standard", "name": "Standard"},
{"value": "addDisabled", "name": "Add Disabled"},
{"value": "removeDisabled", "name": "Remove Disabled"},
{"value": "sortable", "name": "Sortable"}
]
},
{
"type": "section",
"condition": "model.exampleSelector == 'standard'",
"title": "",
"htmlCss": "row",
"items": [
{
"type": "help",
"helpvalue": "<h4>Standard tab array</h4>"
},
{
"key": "standardTabArray",
"type": "tabarray",
"title": "My name is: {{ value.name }}",
"sortOptions": {
"disabled": true
},
"items" : [
{"key": "standardTabArray[].name", "htmlClass": "nameField"},
{"key": "standardTabArray[].nick", "htmlClass": "nickField"}
]
},
]
},
{
"type": "section",
"condition": "model.exampleSelector == 'addDisabled'",
"htmlCss": "row",
"items": [
{
"type": "help",
"helpvalue": "<h4>Tab array with add link hidden</h4>"
},
{
"key": "addDisabledTabArray",
"type": "tabarray",
"add": null,
"title": "My name is: {{ value.name }}",
"sortOptions": {
"disabled": true
},
"items" : [
{"key": "addDisabledTabArray[].name", "htmlClass": "nameField"},
{"key": "addDisabledTabArray[].nick", "htmlClass": "nickField"}
]
}
]
},
{
"type": "section",
"condition": "model.exampleSelector == 'removeDisabled'",
"htmlCss": "row",
"items": [
{
"type": "help",
"helpvalue": "<h4>Tab array with remove button hidden</h4>"
},
{
"key": "removeDisabledTabArray",
"type": "tabarray",
"remove": null,
"title": "My name is: {{ value.name }}",
"sortOptions": {
"disabled": true
},
"items" : [
{"key": "removeDisabledTabArray[].name", "htmlClass": "nameField"},
{"key": "removeDisabledTabArray[].nick", "htmlClass": "nickField"}
]
}
]
},
{
"type": "section",
"condition": "model.exampleSelector == 'sortable'",
"htmlCss": "row",
"items": [
{
"type": "help",
"helpvalue": "<h4>Drag and drop sortable tab array</h4>"
},
{
"key": "sortableTabArray",
"type": "tabarray",
"title": "My name is: {{ value.name }}",
"items" : [
{"key": "sortableTabArray[].name", "htmlClass": "nameField"},
{"key": "sortableTabArray[].nick", "htmlClass": "nickField"}
]
}
]
}
];
}]);
</script>
</head>
<body ng-app="exampleApp" class="container">
<h3>Tab Array Demo</h3>
<p>Drag and drop tabs to order the elements in the array</p>
<div class="container" ng-controller="exampleCtrl" style="margin: 0 auto;width: 100%;">
<form sf-schema="schema" sf-form="form" sf-model="model"></form>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion gulp/tasks/protractor.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ gulp.task('protractor', ['webdriver-update'], function(cb) {
}).on('end', cb);
});

['validation-messages', 'custom-validation', 'sortable-tabarray'].forEach(function(name) {
['validation-messages', 'custom-validation', 'tabarray'].forEach(function(name) {
gulp.task('protractor:' + name, ['webdriver-update'], function(cb) {
gulp.src(['test/protractor/specs/' + name + '.js']).pipe(protractor.protractor({
configFile: 'test/protractor/conf.js',
Expand Down
63 changes: 0 additions & 63 deletions test/protractor/specs/sortable-tabarray.js
View file Open in desktop

This file was deleted.

Loading

AltStyle によって変換されたページ (->オリジナル) /