search-panel form con escape a falta de vn-focus

This commit is contained in:
Vicente Falco 2017-02-07 14:53:30 +01:00
parent 5a6682c773
commit a3fb0a3632
2 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,5 @@
<div pad-large style="min-width: 30em;">
<form name="form" ng-submit="form.$valid && $ctrl.onSubmit()">
<div pad-large style="min-width: 30em;" ng-show="$ctrl.formVisibility">
<form name="form" ng-submit="form.$valid && $ctrl.onSubmit()" ng-keyup="$ctrl.getKeyPressed($event)">
<vn-horizontal>
<vn-textfield vn-one label="Id Cliente" model="$ctrl.filter.id"></vn-textfield>
<vn-textfield vn-one label="NIF/CIF" model="$ctrl.filter.fi"></vn-textfield>

View File

@ -4,7 +4,12 @@ export const NAME = 'vnClientSearchPanel';
export const COMPONENT = {
template: require('./search-panel.html'),
controller: function($scope) {
this.onSubmit = function() {}
this.formVisibility = true;
this.onSubmit = function() {};
this.getKeyPressed = function(event){
if (event.which === 27)
this.formVisibility = false;
};
}
};
module.component(NAME, COMPONENT);