Skip to content

Commit

Permalink
added property errors for polylint
Browse files Browse the repository at this point in the history
  • Loading branch information
tlouisse committed Sep 12, 2016
1 parent 28a4e96 commit 5e527ff
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion paper-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,34 @@
Polymer.PaperInputBehavior
],

properties: {
/*
* Errors that are exposed by validatable element.
* The error with the highest priority in this list will be shown when validatable is in error state, and no error-message is supplied.
*/
errors: {
type: Array,
value: function () {
return [];
}
}
},

/**
* Makes sure only error messages with the highest priority are shown.
* @param {Object} item The error object to be filtered out.
* @return {boolean} True if `value` has the highest priority.
* @return {boolean} whether the item should be shown based on priority
*/
_showHighestPrio: function (item) {
return item.priority < 1;
},

/**
* Determines whether error with highest priority from errors array needs to be shown.
* This error will be visible when property error-message is not supplied and the errors array is not empty.
* @param {Array} errors array
* @return {boolean} whether error with highest priority from errors array will be shown.
*/
_showErrors: function(errors) {
return !this.errorMessage && errors;
}
Expand Down

0 comments on commit 5e527ff

Please sign in to comment.