Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #238 from dgreisen/blur

added input blur and helpful docs

Reviewed-By: Ben Combee (ben.combee@lge.com)
  • Loading branch information...
commit d262ee4d286af2ea3151649b537959e5e30cb769 2 parents becee2e + 930b1ff
@unwiredben unwiredben authored
Showing with 18 additions and 11 deletions.
  1. +18 −0 source/dom/Control.js
  2. +0 −11 source/ui/Input.js
View
18 source/dom/Control.js
@@ -525,6 +525,24 @@ enyo.kind({
hide: function() {
this.setShowing(false);
},
+ //* Focus on this control
+ focus: function() {
+ if (this.hasNode()) {
+ this.node.focus();
+ }
+ },
+ //* Blur this control
+ blur: function() {
+ if (this.hasNode()) {
+ this.node.blur();
+ }
+ },
+ //* Returns true if the control is focused.
+ hasFocus: function() {
+ if (this.hasNode()) {
+ return document.activeElement === this.node;
+ }
+ },
/**
Returns an object describing the geometry of this object, like so:
View
11 source/ui/Input.js
@@ -113,17 +113,6 @@ enyo.kind({
clear: function() {
this.setValue("");
},
- focus: function() {
- if (this.hasNode()) {
- this.node.focus();
- }
- },
- //* Returns true if the Input is focused.
- hasFocus: function() {
- if (this.hasNode()) {
- return document.activeElement === this.node;
- }
- },
// note: we disallow dragging of an input to allow text selection on all platforms
dragstart: function() {
return this.hasFocus();
Please sign in to comment.
Something went wrong with that request. Please try again.