Commit bd0c464479e118e6253ded9b20f35b0d24a89466
1 parent
e21962d5ef
Exists in
master
and in
1 other branch
opcion textarea en modal prompt
Showing
3 changed files
with
15 additions
and
5 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -34,8 +34,9 @@ angular.module('focaModal') |
| 34 | 34 | } |
| 35 | 35 | ]) |
| 36 | 36 | .controller('focaModalPromptController', [ |
| 37 | - '$uibModalInstance', '$scope', 'titulo', 'initValue', | |
| 38 | - function($uibModalInstance, $scope, titulo, initValue) { | |
| 37 | + '$uibModalInstance', '$scope', 'titulo', 'initValue', 'textarea', | |
| 38 | + function($uibModalInstance, $scope, titulo, initValue, textarea) { | |
| 39 | + $scope.textarea = textarea; | |
| 39 | 40 | $scope.titulo = titulo; |
| 40 | 41 | $scope.value = initValue; |
| 41 | 42 | $scope.cancelar = function() { |
src/js/service.js
| ... | ... | @@ -71,14 +71,16 @@ angular.module('focaModal') |
| 71 | 71 | } |
| 72 | 72 | ); |
| 73 | 73 | }, |
| 74 | - prompt: function(titulo, initValue){ | |
| 74 | + prompt: function(titulo, initValue, textarea){ | |
| 75 | + textarea = textarea ? true : false; | |
| 75 | 76 | return $uibModal.open({ |
| 76 | 77 | templateUrl: 'modal-prompt.html', |
| 77 | 78 | controller: 'focaModalPromptController', |
| 78 | 79 | size: 'md', |
| 79 | 80 | resolve: { |
| 80 | 81 | titulo: function() {return titulo;}, |
| 81 | - initValue: function() {return initValue;} | |
| 82 | + initValue: function() {return initValue;}, | |
| 83 | + textarea: function() {return textarea;} | |
| 82 | 84 | } |
| 83 | 85 | }) |
| 84 | 86 | .result.then( |
src/views/modal-prompt.html
| ... | ... | @@ -5,7 +5,14 @@ |
| 5 | 5 | <input |
| 6 | 6 | type="text" |
| 7 | 7 | class="form-control" |
| 8 | - ng-model="value"> | |
| 8 | + ng-model="value" | |
| 9 | + ng-show="!textarea"> | |
| 10 | + | |
| 11 | + <textarea | |
| 12 | + rows="5" | |
| 13 | + class="form-control text-uppercase" | |
| 14 | + ng-model="value" | |
| 15 | + ng-show="textarea"></textarea> | |
| 9 | 16 | </div> |
| 10 | 17 | <div class="modal-footer"> |
| 11 | 18 | <button class="btn btn-primary" ng-click="aceptar()" foca-focus="true">Aceptar</button> |