-
Notifications
You must be signed in to change notification settings - Fork 84
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
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
11aee56
Sortable tab array
joelwkent 0a88586
Support for sortOptions
joelwkent 52c64ff
Example and protractor test for sortable tab arrays
joelwkent 857b5f8
Hide the Add link and Remove button if set to null
joelwkent a24eebc
Example and tests include hiding Add and Remove
joelwkent 2308fe5
Move tab array examples to the existing bootstrap example
joelwkent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
commit a24eebc44dc5f8dad3e933da7d1b26f1d76e7d6c
There are no files selected for viewing
68 changes: 0 additions & 68 deletions
examples/sortable-tabarray.html
Oops, something went wrong.
202 changes: 202 additions & 0 deletions
examples/tabarray.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 0 additions & 63 deletions
test/protractor/specs/sortable-tabarray.js
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.