Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
add documentation to all the methods that are forwarded to the underl…
Browse files Browse the repository at this point in the history
…ying input element
  • Loading branch information
jakemac53 committed Sep 10, 2014
1 parent f58f7ca commit 78c4597
Showing 1 changed file with 62 additions and 9 deletions.
71 changes: 62 additions & 9 deletions core-input.html
Original file line number Diff line number Diff line change
Expand Up @@ -379,47 +379,88 @@
}
},

/**
* Forwards to the internal input / textarea element.
*
* @method blur
*/
blur: function() {
// forward blur method to the internal input / textarea element
this.$.input.blur();
},

/**
* Forwards to the internal input / textarea element.
*
* @method click
*/
click: function() {
// forward click method to the internal input / textarea element
this.$.input.click();
},

/**
* Forwards to the internal input / textarea element.
*
* @method focus
*/
focus: function() {
// forward focus method to the internal input / textarea element
this.$.input.focus();
},

/**
* Forwards to the internal input / textarea element.
*
* @method select
*/
select: function() {
// forward select method to the internal input / textarea element
this.$.input.focus();
this.$.input.select();
},

/**
* Forwards to the internal input / textarea element.
*
* @method setSelectionRange
* @param {number} selectionStart
* @param {number} selectionEnd
* @param {String} selectionDirection (optional)
*/
setSelectionRange: function(selectionStart, selectionEnd, selectionDirection) {
// forward setSelectionRange method to the internal input / textarea element
this.$.input.setSelectionRange(selectionStart, selectionEnd, selectionDirection);
},

/**
* Forwards to the internal input element, not implemented for multiline.
*
* @method setRangeText
* @param {String} replacement
* @param {number} start (optional)
* @param {number} end (optional)
* @param {String} selectMode (optional)
*/
setRangeText: function(replacement, start, end, selectMode) {
// forward setRangeText method to the internal input element
if (!this.multiline) {
this.$.input.setRangeText(replacement, start, end, selectMode);
}
},

/**
* Forwards to the internal input, not implemented for multiline.
*
* @method stepDown
* @param {number} n (optional)
*/
stepDown: function(n) {
// forward stepDown method to the internal input element
if (!this.multiline) {
this.$.input.stepDown(n);
}
},

/**
* Forwards to the internal input, not implemented for multiline.
*
* @method stepUp
* @param {number} n (optional)
*/
stepUp: function(n) {
// forward stepUp method to the internal input element
if (!this.multiline) {
this.$.input.stepUp(n);
}
Expand All @@ -437,12 +478,24 @@
return this.$.input.validationMessage;
},

/**
* Forwards to the internal input / textarea element and updates state.
*
* @method checkValidity
* @return {boolean}
*/
checkValidity: function() {
var r = this.$.input.checkValidity();
this.updateValidity_();
return r;
},

/**
* Forwards to the internal input / textarea element and updates state.
*
* @method setCustomValidity
* @param {number} message
*/
setCustomValidity: function(message) {
this.$.input.setCustomValidity(message);
this.updateValidity_();
Expand Down

0 comments on commit 78c4597

Please sign in to comment.