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

Side by Side Diff: ui/login/account_picker/user_pod_row.js

Issue 2357623003: Submit button incompatiable with desktop chrome. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview User pod row implementation. 6 * @fileoverview User pod row implementation.
7 */ 7 */
8 8
9 cr.define('login', function() { 9 cr.define('login', function() {
10 /** 10 /**
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 * Initializes the pod after its properties set and added to a pod row. 749 * Initializes the pod after its properties set and added to a pod row.
750 */ 750 */
751 initialize: function() { 751 initialize: function() {
752 this.passwordElement.addEventListener('keydown', 752 this.passwordElement.addEventListener('keydown',
753 this.parentNode.handleKeyDown.bind(this.parentNode)); 753 this.parentNode.handleKeyDown.bind(this.parentNode));
754 this.passwordElement.addEventListener('keypress', 754 this.passwordElement.addEventListener('keypress',
755 this.handlePasswordKeyPress_.bind(this)); 755 this.handlePasswordKeyPress_.bind(this));
756 this.passwordElement.addEventListener('input', 756 this.passwordElement.addEventListener('input',
757 this.handleInputChanged_.bind(this)); 757 this.handleInputChanged_.bind(this));
758 758
759 this.submitButton.addEventListener('click', 759 if (this.submitButton) {
760 this.handleSubmitButtonClick_.bind(this)); 760 this.submitButton.addEventListener('click',
761 this.handleSubmitButtonClick_.bind(this));
762 }
761 763
762 this.imageElement.addEventListener('load', 764 this.imageElement.addEventListener('load',
763 this.parentNode.handlePodImageLoad.bind(this.parentNode, this)); 765 this.parentNode.handlePodImageLoad.bind(this.parentNode, this));
764 766
765 var initialAuthType = this.user.initialAuthType || 767 var initialAuthType = this.user.initialAuthType ||
766 AUTH_TYPE.OFFLINE_PASSWORD; 768 AUTH_TYPE.OFFLINE_PASSWORD;
767 this.setAuthType(initialAuthType, null); 769 this.setAuthType(initialAuthType, null);
768 770
769 this.userClickAuthAllowed_ = false; 771 this.userClickAuthAllowed_ = false;
770 772
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 } else if (this.user_.isApp) { 1126 } else if (this.user_.isApp) {
1125 this.setUserPodIconType('app'); 1127 this.setUserPodIconType('app');
1126 } 1128 }
1127 }, 1129 },
1128 1130
1129 isPinReady: function() { 1131 isPinReady: function() {
1130 return this.pinKeyboard && this.pinKeyboard.offsetHeight > 0; 1132 return this.pinKeyboard && this.pinKeyboard.offsetHeight > 0;
1131 }, 1133 },
1132 1134
1133 set showError(visible) { 1135 set showError(visible) {
1134 this.submitButton.classList.toggle('error-shown', visible); 1136 if (this.submitButton)
1137 this.submitButton.classList.toggle('error-shown', visible);
1135 }, 1138 },
1136 1139
1137 toggleTransitions: function(enable) { 1140 toggleTransitions: function(enable) {
1138 this.classList.toggle('flying-pin-pod', enable); 1141 this.classList.toggle('flying-pin-pod', enable);
1139 }, 1142 },
1140 1143
1141 updatePinClass_: function(element, enable) { 1144 updatePinClass_: function(element, enable) {
1142 element.classList.toggle('pin-enabled', enable); 1145 element.classList.toggle('pin-enabled', enable);
1143 element.classList.toggle('pin-disabled', !enable); 1146 element.classList.toggle('pin-disabled', !enable);
1144 }, 1147 },
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1847 */ 1850 */
1848 handlePodMouseDown_: function(e) { 1851 handlePodMouseDown_: function(e) {
1849 this.userClickAuthAllowed_ = this.parentNode.isFocused(this); 1852 this.userClickAuthAllowed_ = this.parentNode.isFocused(this);
1850 }, 1853 },
1851 1854
1852 /** 1855 /**
1853 * Called when the input of the password element changes. Updates the submit 1856 * Called when the input of the password element changes. Updates the submit
1854 * button color and state and hides the error popup bubble. 1857 * button color and state and hides the error popup bubble.
1855 */ 1858 */
1856 updateInput_: function() { 1859 updateInput_: function() {
1857 this.submitButton.disabled = this.passwordElement.value.length <= 0; 1860 if (this.submitButton)
1861 this.submitButton.disabled = this.passwordElement.value.length <= 0;
1858 this.showError = false; 1862 this.showError = false;
1859 $('bubble').hide(); 1863 $('bubble').hide();
1860 }, 1864 },
1861 1865
1862 /** 1866 /**
1863 * Handles pin change event from the pin keyboard. 1867 * Handles pin change event from the pin keyboard.
1864 * @param {Event} e Pin change event. 1868 * @param {Event} e Pin change event.
1865 */ 1869 */
1866 handlePinChanged_: function(e) { 1870 handlePinChanged_: function(e) {
1867 this.passwordElement.value = e.detail.pin; 1871 this.passwordElement.value = e.detail.pin;
1868 this.updateInput_(); 1872 this.updateInput_();
1869 }, 1873 },
1870 1874
1871 /** 1875 /**
1872 * Handles input event on the password element. 1876 * Handles input event on the password element.
1873 * @param {Event} e Input event. 1877 * @param {Event} e Input event.
1874 */ 1878 */
1875 handleInputChanged_: function(e) { 1879 handleInputChanged_: function(e) {
1876 if (this.pinKeyboard) 1880 if (this.pinKeyboard)
1877 this.pinKeyboard.value = this.passwordElement.value; 1881 this.pinKeyboard.value = this.passwordElement.value;
1882 if (this.submitButton)
1883 this.submitButton.disabled = this.passwordElement.value.length <= 0;
1878 this.updateInput_(); 1884 this.updateInput_();
1879 }, 1885 },
1880 1886
1881 /** 1887 /**
1882 * Handles click event on a user pod. 1888 * Handles click event on a user pod.
1883 * @param {Event} e Click event. 1889 * @param {Event} e Click event.
1884 */ 1890 */
1885 handleClickOnPod_: function(e) { 1891 handleClickOnPod_: function(e) {
1886 if (this.parentNode.disabled) 1892 if (this.parentNode.disabled)
1887 return; 1893 return;
(...skipping 1756 matching lines...) Expand 10 before | Expand all | Expand 10 after
3644 if (pod && pod.multiProfilesPolicyApplied) { 3650 if (pod && pod.multiProfilesPolicyApplied) {
3645 pod.userTypeBubbleElement.classList.remove('bubble-shown'); 3651 pod.userTypeBubbleElement.classList.remove('bubble-shown');
3646 } 3652 }
3647 } 3653 }
3648 }; 3654 };
3649 3655
3650 return { 3656 return {
3651 PodRow: PodRow 3657 PodRow: PodRow
3652 }; 3658 };
3653 }); 3659 });
OLDNEW
« no previous file with comments | « ui/login/account_picker/user_pod_row.css ('k') | ui/login/account_picker/user_pod_template.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698