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

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: nits 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 /** 128 /**
129 * Adds event listeners for various events. 129 * Adds event listeners for various events.
130 * @private 130 * @private
131 */ 131 */
132 addEventListeners_: function() { 132 addEventListeners_: function() {
133 this.oninput = this.resetTimer_.bind(this); 133 this.oninput = this.resetTimer_.bind(this);
134 this.onblur = this.onBlur_.bind(this); 134 this.onblur = this.onBlur_.bind(this);
135 this.onkeypress = this.onKeyPressed_.bind(this); 135 this.onkeypress = this.onKeyPressed_.bind(this);
136 this.onkeyup = this.onKeyUp_.bind(this); 136 this.onkeyup = this.onKeyUp_.bind(this);
137 this.onfocus = function() {
138 cr.dispatchSimpleEvent(document, 'marginTextboxFocused');
139 };
137 }, 140 },
138 141
139 /** 142 /**
140 * Executes whenever a blur event occurs. 143 * Executes whenever a blur event occurs.
141 * @private 144 * @private
142 */ 145 */
143 onBlur_: function() { 146 onBlur_: function() {
144 clearTimeout(this.timerId_); 147 clearTimeout(this.timerId_);
145 this.validate(); 148 this.validate();
146 if (!this.isValid) { 149 if (!this.isValid) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 return; 210 return;
208 cr.dispatchSimpleEvent(this, 'MarginsMayHaveChanged'); 211 cr.dispatchSimpleEvent(this, 'MarginsMayHaveChanged');
209 } 212 }
210 213
211 }; 214 };
212 215
213 return { 216 return {
214 MarginTextbox: MarginTextbox 217 MarginTextbox: MarginTextbox
215 }; 218 };
216 }); 219 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/margin_settings.js ('k') | chrome/browser/resources/print_preview/margins.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698