OLD | NEW |
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 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Creates a Margins object that holds four margin values. The units in which | 9 * Creates a Margins object that holds four margin values. The units in which |
10 * the values are expressed can be any numeric value. | 10 * the values are expressed can be any numeric value. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 return false; | 44 return false; |
45 return this[MarginSettings.TOP_GROUP] === rhs[MarginSettings.TOP_GROUP] && | 45 return this[MarginSettings.TOP_GROUP] === rhs[MarginSettings.TOP_GROUP] && |
46 this[MarginSettings.LEFT_GROUP] === rhs[MarginSettings.LEFT_GROUP] && | 46 this[MarginSettings.LEFT_GROUP] === rhs[MarginSettings.LEFT_GROUP] && |
47 this[MarginSettings.RIGHT_GROUP] === | 47 this[MarginSettings.RIGHT_GROUP] === |
48 rhs[MarginSettings.RIGHT_GROUP] && | 48 rhs[MarginSettings.RIGHT_GROUP] && |
49 this[MarginSettings.BOTTOM_GROUP] === | 49 this[MarginSettings.BOTTOM_GROUP] === |
50 rhs[MarginSettings.BOTTOM_GROUP]; | 50 rhs[MarginSettings.BOTTOM_GROUP]; |
51 }, | 51 }, |
52 | 52 |
53 clone: function() { | 53 clone: function() { |
54 return new Margins(this[MarginSettings.TOP_GROUP], | 54 return new Margins(this[MarginSettings.LEFT_GROUP], |
55 this[MarginSettings.LEFT_GROUP], | 55 this[MarginSettings.TOP_GROUP], |
56 this[MarginSettings.RIGHT_GROUP], | 56 this[MarginSettings.RIGHT_GROUP], |
57 this[MarginSettings.BOTTOM_GROUP]); | 57 this[MarginSettings.BOTTOM_GROUP]); |
58 }, | 58 }, |
59 | 59 |
60 /** | 60 /** |
61 * Helper method returning an array of the string indices used for accessing | 61 * Helper method returning an array of the string indices used for accessing |
62 * all margins. | 62 * all margins. |
63 * @return {array} An array of string indices. | 63 * @return {array} An array of string indices. |
64 * @private | 64 * @private |
65 */ | 65 */ |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 this.pageWidth_ = this.currentDefaultPageLayout.pageWidth; | 689 this.pageWidth_ = this.currentDefaultPageLayout.pageWidth; |
690 this.pageHeight_ = this.currentDefaultPageLayout.pageHeight; | 690 this.pageHeight_ = this.currentDefaultPageLayout.pageHeight; |
691 } | 691 } |
692 }; | 692 }; |
693 | 693 |
694 return { | 694 return { |
695 MarginSettings: MarginSettings, | 695 MarginSettings: MarginSettings, |
696 PageLayout: PageLayout, | 696 PageLayout: PageLayout, |
697 }; | 697 }; |
698 }); | 698 }); |
OLD | NEW |