Improve egPromptDialog formatting by wrapping the column div in a row
div. This helps the text input site nicely in the middle of the dialog
without overlaps.
Allow for the creation of egPromptDialog without a user-defined scope.
Pass the result of an egPromptDialog to the dialog resolver in addition
to the optional user-defined scope.ok function.
The 2 above changes reduce the amount of boilerplate code required to
collect the dialog value. For example:
egPromptDialog.open(msg, default_val).result
.then(function(prompt_value) { ... });
Signed-off-by: Bill Erickson <berickxx@gmail.com>
<h4 class="modal-title alert alert-info">{{message}}</h4>
</div>
<div class="modal-body">
- <div class="col-md-12">
- <input ng-keyup="$event.keyCode == 13 ? ok() : null" type='text' ng-model="args.value" class="form-control" focus-me="focus"/>
+ <div class="row">
+ <div class="col-md-12">
+ <input ng-keyup="$event.keyCode == 13 ? ok() : null" type='text'
+ ng-model="args.value" class="form-control" focus-me="focus"/>
+ </div>
</div>
</div>
<div class="modal-footer">
var service = {};
service.open = function(message, promptValue, msg_scope) {
+ msg_scope = msg_scope || {};
return $uibModal.open({
templateUrl: './share/t_prompt_dialog',
controller: ['$scope', '$uibModalInstance',
$scope.focus = true;
$scope.ok = function() {
if (msg_scope.ok) msg_scope.ok($scope.args.value);
- $uibModalInstance.close()
+ $uibModalInstance.close($scope.args.value)
}
$scope.cancel = function() {
if (msg_scope.cancel) msg_scope.cancel();