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

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

Issue 8357009: Print Preview Cleanup: Creating enum with all custom events used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renaming, nts 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 /** 8 /**
9 * @constructor 9 * @constructor
10 * This class represents a margin line and a textbox corresponding to that 10 * This class represents a margin line and a textbox corresponding to that
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 */ 169 */
170 onMouseDown_: function(e) { 170 onMouseDown_: function(e) {
171 if (e.button != 0) 171 if (e.button != 0)
172 return; 172 return;
173 if (e.target != this) 173 if (e.target != this)
174 return; 174 return;
175 var point = print_preview.MarginsUI.convert({x: e.x, y: e.y}); 175 var point = print_preview.MarginsUI.convert({x: e.x, y: e.y});
176 this.originBeforeDragging = { x: this.offsetLeft, y: this.offsetTop }; 176 this.originBeforeDragging = { x: this.offsetLeft, y: this.offsetTop };
177 this.mousePointerOffset = 177 this.mousePointerOffset =
178 { x: point.x - this.offsetLeft, y: point.y - this.offsetTop }; 178 { x: point.x - this.offsetLeft, y: point.y - this.offsetTop };
179 cr.dispatchSimpleEvent(this, 'MarginsLineMouseDown'); 179 cr.dispatchSimpleEvent(this, customEvents.MARGIN_LINE_MOUSE_DOWN);
180 }, 180 },
181 181
182 /** 182 /**
183 * Executes whenever a mouseup event occurs while |this| is dragged. 183 * Executes whenever a mouseup event occurs while |this| is dragged.
184 */ 184 */
185 onMouseUp: function() { 185 onMouseUp: function() {
186 this.box_.onTextValueMayHaveChanged(); 186 this.box_.onTextValueMayHaveChanged();
187 }, 187 },
188 188
189 /** 189 /**
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 287
288 this.rectangle = this.getCoordinates_(newMarginsRectangle); 288 this.rectangle = this.getCoordinates_(newMarginsRectangle);
289 this.drawDraggableArea_(); 289 this.drawDraggableArea_();
290 }, 290 },
291 }; 291 };
292 292
293 return { 293 return {
294 MarginsUIPair: MarginsUIPair 294 MarginsUIPair: MarginsUIPair
295 }; 295 };
296 }); 296 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/margins_ui.js ('k') | chrome/browser/resources/print_preview/page_settings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698