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

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

Issue 23332022: Virtual Keyboard Shift Highlight fixed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed style issues. Now uses double quotes. Created 7 years, 4 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
« no previous file with comments | « no previous file | ui/keyboard/resources/layouts/dvorak.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/resources/elements/kb-keyboard.html
diff --git a/ui/keyboard/resources/elements/kb-keyboard.html b/ui/keyboard/resources/elements/kb-keyboard.html
index 623a8475f1412563994a7c53137106ba7bf9cba6..58bc2af3a7b9572b3f59dbde2d88ba09f403c31e 100644
--- a/ui/keyboard/resources/elements/kb-keyboard.html
+++ b/ui/keyboard/resources/elements/kb-keyboard.html
@@ -183,17 +183,13 @@
* Handles the state of the shift key.
*/
keysetChanged: function() {
- // TODO (rsadam): Generalize to avoid the need to hardcode upper. Add
- // state attribute to shift key.
- if (this.keyset == 'upper') {
- // Deals with the edge case where caps was triggered by a long press.
- // Do not want to highlight the shift key in this case.
- if (!this.classList.contains('caps'))
- this.classList.add('highlight');
- } else {
- this.classList.remove('highlight');
- this.classList.remove('caps');
- }
+ var keysetId = '#' + this.layout + '-' + this.keyset;
+ var keyset = this.querySelector(keysetId);
+
+ // Unlocks the keyboard if the current keyset is not lockable.
+ if (!keyset.getAttribute('lockable'))
+ this.classList.remove('locked');
+
},
ready: function() {
@@ -347,15 +343,14 @@
this.dblDetail_.clickCount++;
if (this.dblDetail_.clickCount == 2) {
this.keyset = this.dblDetail_.toKeyset;
- var keysetId = '#' + this.layout + '-' + this.keyset
- this.querySelector(keysetId).nextKeyset = this.dblTimer_.nextKeyset;
+ var keysetId = '#' + this.layout + '-' + this.keyset;
+ var keyset = this.querySelector(keysetId);
+ keyset.nextKeyset = this.dblTimer_.nextKeyset;
clearTimeout(this.dblTimer_);
// Checks if shift is capitalized.
- if (this.keyset == 'upper') {
- this.classList.remove('highlight');
- this.classList.add('caps');
- }
+ if (keyset.getAttribute('lockable'))
+ this.classList.add('locked');
this.dblDetail_ = null;
}
@@ -442,8 +437,8 @@
this.querySelector('#' + this.layout + '-' + this.keyset).nextKeyset =
detail.nextKeyset;
- // Sets the caps class before removing active to prevent flicker.
- this.classList.add('caps');
+ // Locks the keyset before removing active to prevent flicker.
+ this.classList.add('locked');
// Makes last pressed key inactive if transit to a new keyset on long
// press.
this.lastPressedKey.classList.remove('active');
« no previous file with comments | « no previous file | ui/keyboard/resources/layouts/dvorak.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698