Skip to content

Commit

Permalink
Flexible input type for messagebox.
Browse files Browse the repository at this point in the history
  • Loading branch information
kiarn committed Apr 27, 2023
1 parent a4a78ad commit 49a3117
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ angular.module('core').directive('messageboxContainer', (messagebox) =>
<ng:include ng:if="message.template" src="message.template"></ng:include>
<div ng:show="message.prompt">
<label>{{message.prompt}}</label>
<input type="text" ng:model="message.value" ng:enter="doPositive(message)" class="form-control" autofocus />
<input type="{{message.input_type}}" ng:model="message.value" ng:enter="doPositive(message)" class="form-control" autofocus />
</div>
</div>
<div class="modal-footer">
Expand Down
5 changes: 3 additions & 2 deletions plugins/core/resources/js/core/services/messagebox.service.es
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ angular.module('core').service('messagebox', function($timeout, $q) {
};
};

this.prompt = (prompt, value) => {
this.prompt = (prompt, value, input_type='text') => {
value = value || ''
return this.show({
prompt,
value,
positive: 'OK',
negative: 'Cancel'
negative: 'Cancel',
input_type: input_type
});
};

Expand Down

0 comments on commit 49a3117

Please sign in to comment.