From 1482b842bdac7ae3cc6f60d5910a4b4245e655c6 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 25 May 2017 12:52:38 +0200 Subject: [PATCH] Errores solucionados --- client/client/src/basic-data/index.html | 8 +++----- client/client/src/web-access/index.html | 8 ++++---- client/core/src/autocomplete/index.js | 6 +++--- client/core/src/confirm/index.html | 18 ++++++++-------- client/core/src/confirm/index.js | 6 +----- client/core/src/confirm/style.css | 2 +- client/core/src/dialog/index.html | 19 +++++++++-------- client/core/src/dialog/index.js | 26 ++++++++++++------------ client/core/src/dialog/style.scss | 21 +++++++++++++++++++ client/core/src/icon/index.mdl.html | 2 +- client/core/src/icon/style.css | 1 + client/core/src/locale/en.json | 4 +++- client/core/src/locale/es.json | 4 +++- client/core/src/textfield/index.js | 1 + client/core/src/textfield/index.mdl.html | 5 ++--- services/client/common/models/Client.js | 1 - 16 files changed, 76 insertions(+), 56 deletions(-) diff --git a/client/client/src/basic-data/index.html b/client/client/src/basic-data/index.html index 8829d89b2e..4a4e7c3919 100644 --- a/client/client/src/basic-data/index.html +++ b/client/client/src/basic-data/index.html @@ -29,16 +29,14 @@ value-field="id" select-fields="surname" label="Comercial"> - + {{::i.name}} {{::i.surname}} - + diff --git a/client/client/src/web-access/index.html b/client/client/src/web-access/index.html index 71185cf0c7..1c708b6e84 100644 --- a/client/client/src/web-access/index.html +++ b/client/client/src/web-access/index.html @@ -23,7 +23,7 @@ vn-id="change-pass" on-open="$ctrl.onPassOpen()" on-response="$ctrl.onPassChange(response)"> - + - - + + - + diff --git a/client/core/src/autocomplete/index.js b/client/core/src/autocomplete/index.js index 973462c753..2cd088c9bc 100644 --- a/client/core/src/autocomplete/index.js +++ b/client/core/src/autocomplete/index.js @@ -167,7 +167,7 @@ export default class Autocomplete extends Component { this.destroyScopes(); this.scopes = []; - let hasTemplate = this.$transclude.isSlotFilled('itemTemplate'); + let hasTemplate = this.$transclude.isSlotFilled('tplItem'); for (let i = 0; i < data.length; i++) { let li = this.document.createElement('li'); @@ -178,7 +178,7 @@ export default class Autocomplete extends Component { scope[this.itemAs] = data[i]; li.appendChild(clone[0]); this.scopes[i] = scope; - }, null, 'itemTemplate'); + }, null, 'tplItem'); } else { let text = this.document.createTextNode(data[i][this.showField]); li.appendChild(text); @@ -412,7 +412,7 @@ module.component('vnAutocomplete', { label: '@' }, transclude: { - itemTemplate: '?itemTemplate' + tplItem: '?tplItem' }, controller: Autocomplete }); diff --git a/client/core/src/confirm/index.html b/client/core/src/confirm/index.html index 1b8decb228..82b58f59a8 100644 --- a/client/core/src/confirm/index.html +++ b/client/core/src/confirm/index.html @@ -1,25 +1,23 @@
-
- -
-
+ +
- +
{{$ctrl.question}}
{{$ctrl.message}}
-
+
- + - +
diff --git a/client/core/src/confirm/index.js b/client/core/src/confirm/index.js index 4f63e8a55b..0d7c56cc0d 100644 --- a/client/core/src/confirm/index.js +++ b/client/core/src/confirm/index.js @@ -2,11 +2,7 @@ import {module} from '../module'; import Dialog from '../dialog/index'; import './style.css'; -export default class Confirm extends Dialog { - constructor($element) { - super($element); - } -} +export default class Confirm extends Dialog {} Dialog.$inject = ['$element']; module.component('vnConfirm', { diff --git a/client/core/src/confirm/style.css b/client/core/src/confirm/style.css index dc8f595c9c..7177560fdc 100644 --- a/client/core/src/confirm/style.css +++ b/client/core/src/confirm/style.css @@ -1,5 +1,5 @@ -vn-dialog .dialog-title { +vn-confirm .dialog-title { color:#424242; font-family: raleway-bold; } diff --git a/client/core/src/dialog/index.html b/client/core/src/dialog/index.html index f491e02496..4ccb39e008 100644 --- a/client/core/src/dialog/index.html +++ b/client/core/src/dialog/index.html @@ -1,10 +1,13 @@
-
-
-
-
-
+ +
+
+
+
+
\ No newline at end of file diff --git a/client/core/src/dialog/index.js b/client/core/src/dialog/index.js index 431c41df6b..e45f66b930 100644 --- a/client/core/src/dialog/index.js +++ b/client/core/src/dialog/index.js @@ -29,13 +29,13 @@ export default class Dialog extends Component { let width = this.dialog.offsetWidth; let height = this.dialog.offsetHeight; - if(width + screenMargin > innerWidth) { + if (width + screenMargin > innerWidth) { width = innerWidth - dblMargin; - style.width = width +'px'; + style.width = width + 'px'; } - if(height + screenMargin > innerHeight) { + if (height + screenMargin > innerHeight) { height = innerHeight - dblMargin; - style.height = height +'px'; + style.height = height + 'px'; } this.keypressHandler = @@ -44,7 +44,7 @@ export default class Dialog extends Component { this.keypressHandler); this.element.style.display = 'block'; - if(this.onOpen) + if (this.onOpen) this.onOpen(); } /** @@ -59,7 +59,7 @@ export default class Dialog extends Component { */ fireResponse(response) { let cancel = false; - if(this.onResponse) + if (this.onResponse) cancel = this.onResponse({response: response}); return cancel; } @@ -71,17 +71,17 @@ export default class Dialog extends Component { } onButtonClick(event) { let buttonBar = this.element.querySelector('.button-bar'); - let buttons = buttonBar.querySelector('buttons'); + let buttons = buttonBar.querySelector('tpl-buttons'); let node = event.target; - while(node.parentNode != buttons) { - if(node == buttonBar) return; + while (node.parentNode != buttons) { + if (node == buttonBar) return; node = node.parentNode; } let response = node.getAttribute('response'); let cancel = this.fireResponse(response); - if(cancel !== false) this.realHide(); + if (cancel !== false) this.realHide(); } onDialogMouseDown(event) { this.lastEvent = event; @@ -91,7 +91,7 @@ export default class Dialog extends Component { this.hide(); } onKeypress(event) { - if(event.keyCode == 27) // Esc + if (event.keyCode == 27) // Esc this.hide(); } } @@ -100,8 +100,8 @@ Dialog.$inject = ['$element']; module.component('vnDialog', { template: require('./index.html'), transclude: { - dbody: 'dbody', - buttons: 'buttons' + tplBody: 'tplBody', + tplButtons: 'tplButtons' }, bindings: { onOpen: '&', diff --git a/client/core/src/dialog/style.scss b/client/core/src/dialog/style.scss index 659cdb4904..1b30f5e982 100644 --- a/client/core/src/dialog/style.scss +++ b/client/core/src/dialog/style.scss @@ -8,6 +8,27 @@ width: 100%; background-color: rgba(1,1,1,.4); + button.close { + position: absolute; + top: 0; + right: 0; + border-style: none; + background-color: transparent; + padding: .3em; + cursor: pointer; + + vn-icon { + display: block; + + i { + display: block; + } + } + + &:hover { + background-color: rgba(0, 0, 0, .1); + } + } & > div { position: relative; box-shadow: 0 0 .4em rgba(1,1,1,.4); diff --git a/client/core/src/icon/index.mdl.html b/client/core/src/icon/index.mdl.html index f4b1888dd8..865296d9bc 100644 --- a/client/core/src/icon/index.mdl.html +++ b/client/core/src/icon/index.mdl.html @@ -1 +1 @@ -*[icon]* +*[icon]* diff --git a/client/core/src/icon/style.css b/client/core/src/icon/style.css index fc4dacc93b..064195cd9a 100644 --- a/client/core/src/icon/style.css +++ b/client/core/src/icon/style.css @@ -3,5 +3,6 @@ vn-icon { font-size: 18pt; } vn-icon > i { + display: block; font-size: inherit !important; } \ No newline at end of file diff --git a/client/core/src/locale/en.json b/client/core/src/locale/en.json index f2c3b62b94..5a7186a182 100644 --- a/client/core/src/locale/en.json +++ b/client/core/src/locale/en.json @@ -1,4 +1,6 @@ { "Accept": "Accept", - "Cancel": "Cancel" + "Cancel": "Cancel", + "Close": "Close", + "Clear": "Clear" } \ No newline at end of file diff --git a/client/core/src/locale/es.json b/client/core/src/locale/es.json index cd2b7eea12..96c2c716a0 100644 --- a/client/core/src/locale/es.json +++ b/client/core/src/locale/es.json @@ -1,4 +1,6 @@ { "Accept": "Aceptar", - "Cancel": "Cancelar" + "Cancel": "Cancelar", + "Close": "Cerrar", + "Clear": "Borrar" } \ No newline at end of file diff --git a/client/core/src/textfield/index.js b/client/core/src/textfield/index.js index c7c6731c1e..d556779067 100644 --- a/client/core/src/textfield/index.js +++ b/client/core/src/textfield/index.js @@ -45,6 +45,7 @@ export default class Textfield extends Component { this.showClear(this.input.value); } showClear(show) { + show = document.activeElement === this.input; let clearButton = this.element.querySelector('button'); clearButton.style.visibility = show ? 'visible' : 'hidden'; } diff --git a/client/core/src/textfield/index.mdl.html b/client/core/src/textfield/index.mdl.html index 0a7e31296b..fc4ab00bfb 100644 --- a/client/core/src/textfield/index.mdl.html +++ b/client/core/src/textfield/index.mdl.html @@ -5,13 +5,12 @@ name="*[name]*" ng-model="*[model]*" vn-validation="*[rule]*" - ng-disabled="*[disable]*" - *[enabled]*/> + ng-disabled="*[disable]*"/> diff --git a/services/client/common/models/Client.js b/services/client/common/models/Client.js index 06e78bce77..976f3aaaa6 100644 --- a/services/client/common/models/Client.js +++ b/services/client/common/models/Client.js @@ -66,5 +66,4 @@ module.exports = function(Client) { limit: p.size }; } - }; \ No newline at end of file