| 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.DocumentInfo} documentInfo Document data model. | 10 * @param {!print_preview.DocumentInfo} documentInfo Document data model. |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 if (scaleTransform != this.scaleTransform_) { | 146 if (scaleTransform != this.scaleTransform_) { |
| 147 this.scaleTransform_ = scaleTransform; | 147 this.scaleTransform_ = scaleTransform; |
| 148 for (var orientation in this.controls_) { | 148 for (var orientation in this.controls_) { |
| 149 this.controls_[orientation].setScaleTransform(scaleTransform); | 149 this.controls_[orientation].setScaleTransform(scaleTransform); |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 }, | 152 }, |
| 153 | 153 |
| 154 /** | 154 /** |
| 155 * Clips margin controls to the given clip size in pixels. | 155 * Clips margin controls to the given clip size in pixels. |
| 156 * @param {print_preview.Size} Size to clip the margin controls to. | 156 * @param {print_preview.Size} clipSize Size to clip the margin controls to. |
| 157 */ | 157 */ |
| 158 updateClippingMask: function(clipSize) { | 158 updateClippingMask: function(clipSize) { |
| 159 if (!clipSize) { | 159 if (!clipSize) { |
| 160 return; | 160 return; |
| 161 } | 161 } |
| 162 this.clippingSize_ = clipSize; | 162 this.clippingSize_ = clipSize; |
| 163 for (var orientation in this.controls_) { | 163 for (var orientation in this.controls_) { |
| 164 var el = this.controls_[orientation].getElement(); | 164 var el = this.controls_[orientation].getElement(); |
| 165 el.style.clip = 'rect(' + | 165 el.style.clip = 'rect(' + |
| 166 (-el.offsetTop) + 'px, ' + | 166 (-el.offsetTop) + 'px, ' + |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 } | 456 } |
| 457 } | 457 } |
| 458 } | 458 } |
| 459 }; | 459 }; |
| 460 | 460 |
| 461 // Export | 461 // Export |
| 462 return { | 462 return { |
| 463 MarginControlContainer: MarginControlContainer | 463 MarginControlContainer: MarginControlContainer |
| 464 }; | 464 }; |
| 465 }); | 465 }); |
| OLD | NEW |