Commit c9baa0e8ef63174647c7f648001b8f00de580119

Authored by Eric Fernandez
Exists in master and in 1 other branch develop

Merge branch 'master' into 'master'

Master

See merge request modulos-npm/foca-directivas!8
... ... @@ -6,7 +6,8 @@
6 6 "scripts": {
7 7 "test": "echo \"Error: no test specified\" && exit 1",
8 8 "compile": "gulp uglify",
9   - "postinstall": "npm run compile && gulp clean-post-install"
  9 + "postinstall": "npm run compile && gulp clean-post-install",
  10 + "install-dev": "npm install -D angular gulp gulp-clean gulp-concat gulp-jshint gulp-rename gulp-replace gulp-uglify jquery jshint pump"
10 11 },
11 12 "pre-commit": [
12 13 "gulp-pre-commit"
... ... @@ -30,7 +31,7 @@
30 31 "pump": "^3.0.0"
31 32 },
32 33 "devDependencies": {
33   - "angular": "^1.7.4",
  34 + "angular": "^1.7.5",
34 35 "gulp": "^3.9.1",
35 36 "gulp-clean": "^0.4.0",
36 37 "gulp-concat": "^2.6.1",
src/js/focaTipo-directive.js
... ... @@ -0,0 +1,22 @@
  1 +angular.module('focaDirectivas')
  2 + .directive('focaTipoInput',['$rootScope', function($rootScope) {
  3 + var mostrarTeclado;
  4 + return {
  5 + link: function(scope, element, attr, ctrls) {
  6 + if(mostrarTeclado) {
  7 + element[0].type = 'text';
  8 + return;
  9 + }
  10 + element[0].type = 'number';
  11 + $rootScope.$on('usarTeclado', function(event, data) {
  12 + if(data) {
  13 + mostrarTeclado = true;
  14 + element[0].type = 'text';
  15 + return;
  16 + }
  17 + mostrarTeclado = false;
  18 + element[0].type = 'number';
  19 + });
  20 + }
  21 + }
  22 + }]);