Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: ui/keyboard/resources/elements/kb-key-base.html

Issue 20145004: Switch from text insertion to key press and release events on the virtual k… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code cleanup. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698