Commit 3b82dc345e94449265115bc8a1d303838a522505

Authored by Nicolás Guarnieri
Exists in master

Merge branch 'master' into 'master'

Master

See merge request !14
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() {
... ... @@ -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>