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 LayoutSettings object. This object encapsulates all settings and | 9 * Creates a LayoutSettings object. This object encapsulates all settings and |
10 * logic related to layout mode (portrait/landscape). | 10 * logic related to layout mode (portrait/landscape). |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 * if not. | 43 * if not. |
44 */ | 44 */ |
45 isLandscape: function() { | 45 isLandscape: function() { |
46 return this.landscapeRadioButton_.checked; | 46 return this.landscapeRadioButton_.checked; |
47 }, | 47 }, |
48 | 48 |
49 /** | 49 /** |
50 * @return {boolean} true if the chosen layout mode has changed since last | 50 * @return {boolean} true if the chosen layout mode has changed since last |
51 * time the state was updated. | 51 * time the state was updated. |
52 */ | 52 */ |
53 hasChanged_ : function() { | 53 hasChanged_: function() { |
54 return this.isLandscape() != this.wasLandscape_; | 54 return this.isLandscape() != this.wasLandscape_; |
55 }, | 55 }, |
56 | 56 |
57 /** | 57 /** |
58 * Saves the currently selected layout mode. Used in |this.hasChanged_|. | 58 * Saves the currently selected layout mode. Used in |this.hasChanged_|. |
59 */ | 59 */ |
60 updateState : function() { | 60 updateState: function() { |
61 this.wasLandscape_ = this.isLandscape(); | 61 this.wasLandscape_ = this.isLandscape(); |
62 }, | 62 }, |
63 | 63 |
64 /** | 64 /** |
65 * Adding listeners to all layout related controls. The listeners take care | 65 * Adding listeners to all layout related controls. The listeners take care |
66 * of altering their behavior depending on |hasPendingPreviewRequest|. | 66 * of altering their behavior depending on |hasPendingPreviewRequest|. |
67 * @private | 67 * @private |
68 */ | 68 */ |
69 addEventListeners_: function() { | 69 addEventListeners_: function() { |
70 this.landscapeRadioButton_.onclick = this.onLayoutButtonClick_.bind(this); | 70 this.landscapeRadioButton_.onclick = this.onLayoutButtonClick_.bind(this); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 fadeInOut_: function(fadeOut) { | 111 fadeInOut_: function(fadeOut) { |
112 fadeOut ? fadeOutOption(this.layoutOption_) : | 112 fadeOut ? fadeOutOption(this.layoutOption_) : |
113 fadeInOption(this.layoutOption_); | 113 fadeInOption(this.layoutOption_); |
114 } | 114 } |
115 }; | 115 }; |
116 | 116 |
117 return { | 117 return { |
118 LayoutSettings: LayoutSettings, | 118 LayoutSettings: LayoutSettings, |
119 }; | 119 }; |
120 }); | 120 }); |
OLD | NEW |