Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: chrome/browser/resources/print_preview/data/ticket_items/ticket_item.js

Issue 2862203002: Print Preview: Fix data/ errors (Closed)
Patch Set: Make tests pass Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/print_preview/data/ticket_items/ticket_item.js
diff --git a/chrome/browser/resources/print_preview/data/ticket_items/ticket_item.js b/chrome/browser/resources/print_preview/data/ticket_items/ticket_item.js
index 4e51aaa8fdf04c3ad28257844e6eb8505a1767af..200396a36b6de8755462bfae28fb93631ec0e234 100644
--- a/chrome/browser/resources/print_preview/data/ticket_items/ticket_item.js
+++ b/chrome/browser/resources/print_preview/data/ticket_items/ticket_item.js
@@ -16,7 +16,7 @@ cr.define('print_preview.ticket_items', function() {
* if other ticket item constraints are not met.
* @param {?print_preview.AppState} appState Application state model to update
* when ticket items update.
- * @param {?print_preview.AppState.Field} field Field of the app state to
+ * @param {?print_preview.AppStateField} field Field of the app state to
* update when ticket item is updated.
* @param {?print_preview.DestinationStore} destinationStore Used listen for
* changes in the currently selected destination's capabilities. Since
@@ -40,7 +40,7 @@ cr.define('print_preview.ticket_items', function() {
/**
* Field of the app state to update when ticket item is updated.
- * @type {?print_preview.AppState.Field}
+ * @type {?print_preview.AppStateField}
* @private
*/
this.field_ = field || null;
@@ -75,7 +75,7 @@ cr.define('print_preview.ticket_items', function() {
this.tracker_ = new EventTracker();
this.addEventHandlers_();
- };
+ }
/**
* Event types dispatched by this class.
@@ -147,7 +147,7 @@ cr.define('print_preview.ticket_items', function() {
var sendUpdateEvent = !this.isValueEqual(value);
// Don't lose requested value if capability is not available.
this.updateValueInternal(value);
- if (this.appState_) {
+ if (this.appState_ && this.field_) {
dpapad 2017/05/05 17:32:53 Is this 100% equivalent? What if |this.field_| was
rbpotter 2017/05/05 18:25:46 Done.
this.appState_.persistField(this.field_, value);
}
if (sendUpdateEvent)

Powered by Google App Engine
This is Rietveld 408576698