Commit 6f7303544f5429a2b828ad15003f7a24315eab76
Exists in
master
Merge branch 'master' into 'master'
Master See merge request !15
Showing
3 changed files
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', 'textarea', | |
38 | - function($uibModalInstance, $scope, titulo, initValue, textarea) { | |
37 | + '$uibModalInstance', '$scope', 'titulo', 'initValue', 'textarea', 'readonly', | |
38 | + function($uibModalInstance, $scope, titulo, initValue, textarea, readonly) { | |
39 | + $scope.readonly = readonly; | |
39 | 40 | $scope.textarea = textarea; |
40 | 41 | $scope.titulo = titulo; |
41 | 42 | $scope.value = initValue; |
src/js/service.js
... | ... | @@ -71,8 +71,9 @@ angular.module('focaModal') |
71 | 71 | } |
72 | 72 | ); |
73 | 73 | }, |
74 | - prompt: function(titulo, initValue, textarea){ | |
74 | + prompt: function(titulo, initValue, textarea, readonly){ | |
75 | 75 | textarea = textarea ? true : false; |
76 | + readonly = readonly ? true : false; | |
76 | 77 | return $uibModal.open({ |
77 | 78 | templateUrl: 'modal-prompt.html', |
78 | 79 | controller: 'focaModalPromptController', |
... | ... | @@ -80,7 +81,8 @@ angular.module('focaModal') |
80 | 81 | resolve: { |
81 | 82 | titulo: function() {return titulo;}, |
82 | 83 | initValue: function() {return initValue;}, |
83 | - textarea: function() {return textarea;} | |
84 | + textarea: function() {return textarea;}, | |
85 | + readonly: function() {return readonly;} | |
84 | 86 | } |
85 | 87 | }) |
86 | 88 | .result.then( |
src/views/modal-prompt.html
... | ... | @@ -6,13 +6,15 @@ |
6 | 6 | type="text" |
7 | 7 | class="form-control" |
8 | 8 | ng-model="value" |
9 | - ng-show="!textarea"> | |
9 | + ng-show="!textarea" | |
10 | + ng-readonly="readonly"> | |
10 | 11 | |
11 | 12 | <textarea |
12 | 13 | rows="5" |
13 | 14 | class="form-control text-uppercase" |
14 | 15 | ng-model="value" |
15 | - ng-show="textarea"></textarea> | |
16 | + ng-show="textarea" | |
17 | + ng-readonly="readonly"></textarea> | |
16 | 18 | </div> |
17 | 19 | <div class="modal-footer"> |
18 | 20 | <button class="btn btn-primary" ng-click="aceptar()" foca-focus="true">Aceptar</button> |