Skip to content

Commit

Permalink
General Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jesuslopezlugo committed Jan 16, 2018
1 parent 6e4e2e7 commit f19eb00
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pt-multilang-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@
set value(value){
let inputs = this.shadowRoot.querySelectorAll('#ironPages > *');
inputs.forEach((input) =>{
input.value = value[input.dataLang] ? value[input.dataLang] : "";
try {
input.value = value[input.dataLang];
} catch (e) {
input.value = "";
}
});
}

Expand All @@ -182,8 +186,12 @@
validate(){
let inputs = this.shadowRoot.querySelectorAll('#ironPages > *');
for (let i = 0; i < inputs.length; i++) {
if (inputs[i].validate && !inputs[i].validate())
return false;
try {
if (!inputs[i].validate())
return false;
} catch (e) {

}
}
return true;
}
Expand All @@ -192,4 +200,4 @@

window.customElements.define(PtMultilangInput.is, PtMultilangInput);
</script>
</dom-module>
</dom-module>

0 comments on commit f19eb00

Please sign in to comment.