Skip to content

Commit

Permalink
#394 set the focus to the input fields on the move and rename dialogs…
Browse files Browse the repository at this point in the history
… so there's less clicking/typing required and allow auto-submit on return
  • Loading branch information
jstrachan committed Jul 16, 2013
1 parent 12569ca commit 07c9685
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
46 changes: 24 additions & 22 deletions hawtio-web/src/main/webapp/app/wiki/html/viewPage.html
Expand Up @@ -123,42 +123,44 @@
</div>

<div modal="moveDialog.show" close="moveDialog.close()" ng-options="moveDialog.options">
<div class="modal-header"><h4>Move Document</h4></div>
<div class="modal-body">
<form class="form-horizontal">
<form class="form-horizontal" ng-submit="moveAndCloseDialog()">
<div class="modal-header"><h4>Move Document</h4></div>
<div class="modal-body">
<div class="control-group">
<label class="control-label" for="moveFolder">Folder</label>

<div class="controls">
<input type="text" id="moveFolder" ng-model="moveFolder">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<input class="btn btn-primary" type="submit" ng-click="moveAndCloseDialog()"
ng-disabled="!moveFolder"
value="Move">
<button class="btn btn-warning cancel" type="button" ng-click="moveDialog.close()">Cancel</button>
</div>
</div>
<div class="modal-footer">
<input class="btn btn-primary" type="submit"
ng-disabled="!moveFolder"
value="Move">
<button class="btn btn-warning cancel" type="button" ng-click="moveDialog.close()">Cancel</button>
</div>
</form>
</div>

<div modal="renameDialog.show" close="renameDialog.close()" ng-options="renameDialog.options">
<div class="modal-header"><h4>Rename Document</h4></div>
<div class="modal-body">
<form class="form-horizontal">
<form class="form-horizontal" ng-submit="renameAndCloseDialog()">
<div class="modal-header"><h4>Rename Document</h4></div>
<div class="modal-body">
<div class="control-group">
<label class="control-label" for="renameFileName">Name</label>

<div class="controls">
<input type="text" id="renameFileName" ng-model="fileName">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<input class="btn btn-primary" type="submit" ng-click="renameAndCloseDialog()"
ng-disabled="!fileName"
value="Rename">
<button class="btn btn-warning cancel" type="button" ng-click="renameDialog.close()">Cancel</button>
</div>
</div>
<div class="modal-footer">
<input class="btn btn-primary" type="submit"
ng-disabled="!fileName"
value="Rename">
<button class="btn btn-warning cancel" type="button" ng-click="renameDialog.close()">Cancel</button>
</div>
</form>
</div>
</div>
6 changes: 6 additions & 0 deletions hawtio-web/src/main/webapp/app/wiki/js/view.ts
Expand Up @@ -248,6 +248,9 @@ module Wiki {
if (name) {
$scope.fileName = name;
$scope.renameDialog.open();
$timeout(() => {
$('#renameFileName').focus();
}, 50);
} else {
console.log("No items selected right now! " + $scope.gridOptions.selectedItems);
}
Expand Down Expand Up @@ -277,6 +280,9 @@ module Wiki {
if ($scope.gridOptions.selectedItems.length) {
$scope.moveFolder = $scope.pageId;
$scope.moveDialog.open();
$timeout(() => {
$('#moveFolder').focus();
}, 50);
} else {
console.log("No items selected right now! " + $scope.gridOptions.selectedItems);
}
Expand Down

0 comments on commit 07c9685

Please sign in to comment.