Index: ui/keyboard/resources/elements/kb-key-base.html |
diff --git a/ui/keyboard/resources/elements/kb-key-base.html b/ui/keyboard/resources/elements/kb-key-base.html |
index 0b017ff3d4561662bf535c9fe3a49a2ea3c5bb2c..5968c9c3f18e17bdd0b6dd66ca3417c3add50992 100644 |
--- a/ui/keyboard/resources/elements/kb-key-base.html |
+++ b/ui/keyboard/resources/elements/kb-key-base.html |
@@ -109,11 +109,7 @@ |
} |
}, |
down: function(event) { |
- var detail = { |
- char: this.charValue, |
- toLayout: this.toLayout, |
- repeat: this.repeat |
- }; |
+ var detail = this.PopulateDetails(); |
if (this.keysetRules && this.keysetRules.down != undefined) { |
detail.toKeyset = this.keysetRules.down[TO_KEYSET - OFFSET]; |
detail.nextKeyset = this.keysetRules.down[NEXT_KEYSET - OFFSET]; |
@@ -136,10 +132,7 @@ |
}, |
up: function(event) { |
clearTimeout(this.longPressTimer); |
- var detail = { |
- char: this.charValue, |
- toLayout: this.toLayout |
- }; |
+ var detail = this.PopulateDetails(); |
if (this.keysetRules && this.keysetRules.up != undefined) { |
detail.toKeyset = this.keysetRules.up[TO_KEYSET - OFFSET]; |
detail.nextKeyset = this.keysetRules.up[NEXT_KEYSET - OFFSET]; |
@@ -156,6 +149,14 @@ |
get charValue() { |
return this.char || this.textContent; |
}, |
+ |
+ PopulateDetails: function() { |
+ return { |
+ char: this.charValue, |
+ toLayout: this.toLayout, |
+ repeat: this.repeat |
+ }; |
+ }, |
}); |
</script> |
</polymer-element> |