aboutsummaryrefslogtreecommitdiff
path: root/web/static/app/templates/device-edit-attribute.modal.html
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-10-31 20:04:06 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-10-31 20:04:06 +0100
commit141cb7cba5c36a9c5415772e2de9823f927d7abb (patch)
tree03354c1437db7760ca0a44f0ec99b1dfb4a7a162 /web/static/app/templates/device-edit-attribute.modal.html
parent9d97d8f89bc570b1232c0dd8450f489b39023e18 (diff)
downloaddiller-server-141cb7cba5c36a9c5415772e2de9823f927d7abb.tar.gz
diller-server-141cb7cba5c36a9c5415772e2de9823f927d7abb.tar.bz2
diller-server-141cb7cba5c36a9c5415772e2de9823f927d7abb.tar.xz
diller-server-141cb7cba5c36a9c5415772e2de9823f927d7abb.zip
web:
o Better form interaction: enter to submit and autofocus on the field.
Diffstat (limited to 'web/static/app/templates/device-edit-attribute.modal.html')
-rw-r--r--web/static/app/templates/device-edit-attribute.modal.html48
1 files changed, 26 insertions, 22 deletions
diff --git a/web/static/app/templates/device-edit-attribute.modal.html b/web/static/app/templates/device-edit-attribute.modal.html
index fc22d7b..10314e5 100644
--- a/web/static/app/templates/device-edit-attribute.modal.html
+++ b/web/static/app/templates/device-edit-attribute.modal.html
@@ -1,28 +1,32 @@
-<div class="modal-header">
- <button type="button" class="close" ng-click="$dismiss()">
- <span>&times;</span>
- </button>
- <h4 class="modal-title">Edit device {{ctrl.attributeName}}</h4>
-</div>
-<div class="modal-body">
- <form>
+<form name="form" ng-submit="ctrl.update()">
+ <div class="modal-header">
+ <button type="button" class="close" ng-click="$dismiss()">
+ <span>&times;</span>
+ </button>
+ <h4 class="modal-title">Edit device {{ctrl.attributeName}}</h4>
+ </div>
+ <div class="modal-body">
<fieldset class="form-group">
<label for="attribute" style="text-transform: capitalize">{{ctrl.label}}</label>
- <input type="email" class="form-control" id="attribute" ng-model="ctrl.value"/>
+ <input type="text" class="form-control" id="attribute" autofocus
+ ng-model="ctrl.value"/>
</fieldset>
- </form>
-</div>
-<div class="modal-footer">
+ </div>
+ <div class="modal-footer">
- <div class="row">
- <div class="col-sm-7 text-left">
- <p class="form-control-static">
- {{ctrl.error}}
- </p>
- </div>
- <div class="col-sm-5">
- <button type="button" class="btn btn-secondary" ng-click="$dismiss()">Cancel</button>
- <button type="button" class="btn btn-primary" ng-click="ctrl.update()">Update</button>
+ <div class="row">
+ <div class="col-sm-7 text-left">
+ <p class="form-control-static">
+ {{ctrl.error}}
+ </p>
+ </div>
+ <div class="col-sm-5">
+ <button type="button" class="btn btn-secondary" ng-click="$dismiss()">Cancel</button>
+ <button type="submit" class="btn btn-primary"
+ ng-disabled="form.$invalid">
+ Update
+ </button>
+ </div>
</div>
</div>
-</div>
+</form>