| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * UI component used for setting custom print margins. | 9 * UI component used for setting custom print margins. |
| 10 * @param {!print_preview.PrintTicketStore} printTicketStore Used to read and | 10 * @param {!print_preview.PrintTicketStore} printTicketStore Used to read and |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 /** | 25 /** |
| 26 * Used to convert between the system's local units and points. | 26 * Used to convert between the system's local units and points. |
| 27 * @type {!print_preview.MeasurementSystem} | 27 * @type {!print_preview.MeasurementSystem} |
| 28 * @private | 28 * @private |
| 29 */ | 29 */ |
| 30 this.measurementSystem_ = printTicketStore.measurementSystem; | 30 this.measurementSystem_ = printTicketStore.measurementSystem; |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * Convenience array that contains all of the margin controls. | 33 * Convenience array that contains all of the margin controls. |
| 34 * @type {!Object< | 34 * @type {!Object.< |
| 35 * print_preview.ticket_items.CustomMargins.Orientation, | 35 * !print_preview.ticket_items.CustomMargins.Orientation, |
| 36 * !print_preview.MarginControl>} | 36 * !print_preview.MarginControl>} |
| 37 * @private | 37 * @private |
| 38 */ | 38 */ |
| 39 this.controls_ = {}; | 39 this.controls_ = {}; |
| 40 for (var key in print_preview.ticket_items.CustomMargins.Orientation) { | 40 for (var key in print_preview.ticket_items.CustomMargins.Orientation) { |
| 41 var orientation = print_preview.ticket_items.CustomMargins.Orientation[ | 41 var orientation = print_preview.ticket_items.CustomMargins.Orientation[ |
| 42 key]; | 42 key]; |
| 43 var control = new print_preview.MarginControl(orientation); | 43 var control = new print_preview.MarginControl(orientation); |
| 44 this.controls_[orientation] = control; | 44 this.controls_[orientation] = control; |
| 45 this.addChild(control); | 45 this.addChild(control); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 * CSS classes used by the custom margins component. | 83 * CSS classes used by the custom margins component. |
| 84 * @enum {string} | 84 * @enum {string} |
| 85 * @private | 85 * @private |
| 86 */ | 86 */ |
| 87 MarginControlContainer.Classes_ = { | 87 MarginControlContainer.Classes_ = { |
| 88 DRAGGING_HORIZONTAL: 'margin-control-container-dragging-horizontal', | 88 DRAGGING_HORIZONTAL: 'margin-control-container-dragging-horizontal', |
| 89 DRAGGING_VERTICAL: 'margin-control-container-dragging-vertical' | 89 DRAGGING_VERTICAL: 'margin-control-container-dragging-vertical' |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 /** | 92 /** |
| 93 * @param {print_preview.ticket_items.CustomMargins.Orientation} orientation | 93 * @param {!print_preview.ticket_items.CustomMargins.Orientation} orientation |
| 94 * Orientation value to test. | 94 * Orientation value to test. |
| 95 * @return {boolean} Whether the given orientation is TOP or BOTTOM. | 95 * @return {boolean} Whether the given orientation is TOP or BOTTOM. |
| 96 * @private | 96 * @private |
| 97 */ | 97 */ |
| 98 MarginControlContainer.isTopOrBottom_ = function(orientation) { | 98 MarginControlContainer.isTopOrBottom_ = function(orientation) { |
| 99 return orientation == | 99 return orientation == |
| 100 print_preview.ticket_items.CustomMargins.Orientation.TOP || | 100 print_preview.ticket_items.CustomMargins.Orientation.TOP || |
| 101 orientation == | 101 orientation == |
| 102 print_preview.ticket_items.CustomMargins.Orientation.BOTTOM; | 102 print_preview.ticket_items.CustomMargins.Orientation.BOTTOM; |
| 103 }; | 103 }; |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 } | 437 } |
| 438 } | 438 } |
| 439 } | 439 } |
| 440 }; | 440 }; |
| 441 | 441 |
| 442 // Export | 442 // Export |
| 443 return { | 443 return { |
| 444 MarginControlContainer: MarginControlContainer | 444 MarginControlContainer: MarginControlContainer |
| 445 }; | 445 }; |
| 446 }); | 446 }); |
| OLD | NEW |