Commit 611472bd authored by rbpotter's avatar rbpotter Committed by Commit Bot

Print Preview Componentization: Do not change height in JS

Bug: 773928
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I7089a22f7e9ed0da2a1df1320f0a3d1e511a5c67
Reviewed-on: https://chromium-review.googlesource.com/902793Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534622}
parent 932a24c7
...@@ -34,9 +34,11 @@ ...@@ -34,9 +34,11 @@
box-sizing: border-box; box-sizing: border-box;
padding-top: 0; padding-top: 0;
} }
--cr-dialog-wrapper: {
max-height: calc(100vh - 40px);
}
box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2), box-shadow: 0 4px 23px 5px rgba(0, 0, 0, 0.2),
0 2px 6px rgba(0, 0, 0, 0.15); 0 2px 6px rgba(0, 0, 0, 0.15);
height: calc(100% - 40px);
width: 640px; width: 640px;
} }
...@@ -45,6 +47,10 @@ ...@@ -45,6 +47,10 @@
margin-top: 14px; margin-top: 14px;
} }
:host #lists {
height: 100vh;
}
:host #dialog .cloudprint-promo { :host #dialog .cloudprint-promo {
align-items: center; align-items: center;
background-color: #f5f5f5; background-color: #f5f5f5;
......
...@@ -62,7 +62,6 @@ Polymer({ ...@@ -62,7 +62,6 @@ Polymer({
destinationStore, destinationStore,
print_preview.DestinationStore.EventType.DESTINATION_SEARCH_DONE, print_preview.DestinationStore.EventType.DESTINATION_SEARCH_DONE,
this.updateDestinations_.bind(this)); this.updateDestinations_.bind(this));
this.tracker_.add(window, 'resize', this.updateHeight_.bind(this));
}, },
/** @private */ /** @private */
...@@ -123,20 +122,9 @@ Polymer({ ...@@ -123,20 +122,9 @@ Polymer({
this.$.dialog.close(); this.$.dialog.close();
}, },
/** @private */
updateHeight_: function() {
const heightNum = this.$.dialog.getBoundingClientRect().height -
this.$$('.cloudprint-promo').offsetHeight -
this.$.buttons.offsetHeight - this.$.titleBox.offsetHeight;
this.$.lists.style.height = `${heightNum}px`;
this.$.lists.style.minHeight = `${heightNum}px`;
},
show: function() { show: function() {
this.loadingDestinations_ = this.loadingDestinations_ =
this.destinationStore.isPrintDestinationSearchInProgress; this.destinationStore.isPrintDestinationSearchInProgress;
this.$.dialog.showModal(); this.$.dialog.showModal();
this.updateHeight_();
}, },
}); });
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
flex-direction: column; flex-direction: column;
max-height: 100vh; max-height: 100vh;
overflow: auto; overflow: auto;
@apply(--cr-dialog-wrapper);
} }
/* When needing to flex, force .body-container alone to shrink. */ /* When needing to flex, force .body-container alone to shrink. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment