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

Side by Side Diff: chrome/browser/resources/print_preview/margin_textbox.js

Issue 8394020: Print Preview: Improving accessibility of margins UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'strict'; 6 'strict';
7 7
8 function MarginTextbox(groupName) { 8 function MarginTextbox(groupName) {
9 var box = document.createElement('input'); 9 var box = document.createElement('input');
10 box.__proto__ = MarginTextbox.prototype; 10 box.__proto__ = MarginTextbox.prototype;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 /** 127 /**
128 * Adds event listeners for various events. 128 * Adds event listeners for various events.
129 * @private 129 * @private
130 */ 130 */
131 addEventListeners_: function() { 131 addEventListeners_: function() {
132 this.oninput = this.resetTimer_.bind(this); 132 this.oninput = this.resetTimer_.bind(this);
133 this.onblur = this.onBlur_.bind(this); 133 this.onblur = this.onBlur_.bind(this);
134 this.onkeypress = this.onKeyPressed_.bind(this); 134 this.onkeypress = this.onKeyPressed_.bind(this);
135 this.onkeyup = this.onKeyUp_.bind(this); 135 this.onkeyup = this.onKeyUp_.bind(this);
136 this.onfocus = function() {
137 cr.dispatchSimpleEvent(document, 'marginTextboxFocused');
138 };
136 }, 139 },
137 140
138 /** 141 /**
139 * Executes whenever a blur event occurs. 142 * Executes whenever a blur event occurs.
140 * @private 143 * @private
141 */ 144 */
142 onBlur_: function() { 145 onBlur_: function() {
143 clearTimeout(this.timerId_); 146 clearTimeout(this.timerId_);
144 this.validate(); 147 this.validate();
145 if (!this.isValid) { 148 if (!this.isValid) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 return; 209 return;
207 cr.dispatchSimpleEvent(this, 'MarginsMayHaveChanged'); 210 cr.dispatchSimpleEvent(this, 'MarginsMayHaveChanged');
208 } 211 }
209 212
210 }; 213 };
211 214
212 return { 215 return {
213 MarginTextbox: MarginTextbox 216 MarginTextbox: MarginTextbox
214 }; 217 };
215 }); 218 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698