| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.ticket_items', function() { | 5 cr.define('print_preview.ticket_items', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * An object that represents a user modifiable item in a print ticket. Each | 9 * An object that represents a user modifiable item in a print ticket. Each |
| 10 * ticket item has a value which can be set by the user. Ticket items can also | 10 * ticket item has a value which can be set by the user. Ticket items can also |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 __proto__: cr.EventTarget.prototype, | 46 __proto__: cr.EventTarget.prototype, |
| 47 | 47 |
| 48 /** @return {boolean} Whether vendor capabilities are available. */ | 48 /** @return {boolean} Whether vendor capabilities are available. */ |
| 49 isCapabilityAvailable: function() { | 49 isCapabilityAvailable: function() { |
| 50 return !!this.capability; | 50 return !!this.capability; |
| 51 }, | 51 }, |
| 52 | 52 |
| 53 /** @return {boolean} Whether the ticket item was modified by the user. */ | 53 /** @return {boolean} Whether the ticket item was modified by the user. */ |
| 54 isUserEdited: function() { | 54 isUserEdited: function() { |
| 55 // If there's at least one ticket item stored in values, it was edited. | 55 // If there's at least one ticket item stored in values, it was edited. |
| 56 for (var key in values) { | 56 for (var key in this.items_) { |
| 57 if (values.hasOwnProperty(key)) | 57 if (this.items_.hasOwnProperty(key)) |
| 58 return true; | 58 return true; |
| 59 } | 59 } |
| 60 return false; | 60 return false; |
| 61 }, | 61 }, |
| 62 | 62 |
| 63 /** @return {Object} Media size capability of the selected destination. */ | 63 /** @return {Object} Media size capability of the selected destination. */ |
| 64 get capability() { | 64 get capability() { |
| 65 var destination = this.destinationStore_ ? | 65 var destination = this.destinationStore_ ? |
| 66 this.destinationStore_.selectedDestination : null; | 66 this.destinationStore_.selectedDestination : null; |
| 67 return (destination && | 67 return (destination && |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 print_preview.AppState.Field.VENDOR_OPTIONS, this.items_); | 99 print_preview.AppState.Field.VENDOR_OPTIONS, this.items_); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 // Export | 104 // Export |
| 105 return { | 105 return { |
| 106 VendorItems: VendorItems | 106 VendorItems: VendorItems |
| 107 }; | 107 }; |
| 108 }); | 108 }); |
| OLD | NEW |