Commit af2b70a8 authored by Michael Checo's avatar Michael Checo Committed by Commit Bot

Print Jobs: add tooltip for truncated text of print job entries

Screenshot: http://shortn/_9HmkoESwea

Bug: 1122235
Test: manual inspection
Change-Id: I2c02dedb2b6f2201ae147349f60f872b247055bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2386488
Commit-Queue: Michael Checo <michaelcheco@google.com>
Reviewed-by: default avatarJimmy Gong <jimmyxgong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805909}
parent 5be14cd5
...@@ -229,11 +229,34 @@ Polymer({ ...@@ -229,11 +229,34 @@ Polymer({
*/ */
showFullOngoingStatus_: Boolean, showFullOngoingStatus_: Boolean,
}, },
observers: [
'printJobEntryDataChanged_(jobTitle_, printerName_, creationTime_, ' +
'completionStatus_)'
],
listeners: { listeners: {
'click': 'onClick_', 'click': 'onClick_',
}, },
/**
* Check if any elements with the class "overflow-ellipsis" needs to
* add/remove the title attribute.
* @private
*/
printJobEntryDataChanged_() {
Array.from(this.shadowRoot.querySelectorAll('.overflow-ellipsis')).forEach(
(/** @type {HTMLElement} */ e) => {
// Checks if text is truncated
if (e.offsetWidth < e.scrollWidth) {
e.setAttribute("title", e.textContent);
}
else {
e.removeAttribute("title");
}
}
)
},
/** @private */ /** @private */
onClick_() { onClick_() {
// Since the status or cancel button has the focus-row-control attribute, // Since the status or cancel button has the focus-row-control attribute,
......
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