Upgrade gr-dropdown for download links

Bug: Issue 7867
Change-Id: I80803e388862872cb059c7f7ec0c269ce6a80755
This commit is contained in:
Kasper Nilsson
2018-05-15 12:51:19 -07:00
parent 8f67359caf
commit 7f25f0fa16
3 changed files with 10 additions and 0 deletions

View File

@@ -145,6 +145,7 @@ limitations under the License.
<a
class="itemAction"
href$="[[_computeLinkURL(link)]]"
download$="[[_computeIsDownload(link)]]"
rel$="[[_computeLinkRel(link)]]"
target$="[[link.target]]"
hidden$="[[!link.url]]"

View File

@@ -286,5 +286,9 @@
_computeHasTooltip(tooltip) {
return !!tooltip;
},
_computeIsDownload(link) {
return !!link.download;
},
});
})();

View File

@@ -49,6 +49,11 @@ limitations under the License.
sandbox.restore();
});
test('_computeIsDownload', () => {
assert.isTrue(element._computeIsDownload({download: true}));
assert.isFalse(element._computeIsDownload({download: false}));
});
test('tap on trigger opens menu, then closes', () => {
sandbox.stub(element, '_open', () => { element.$.dropdown.open(); });
sandbox.stub(element, '_close', () => { element.$.dropdown.close(); });