Commit a245cdbf authored by dpapad's avatar dpapad Committed by Commit Bot

WebUI: Change remaining 'tap' listeners to native 'click'.

In this CL ignoring 'tap' listeners residing in CrOS only code, or
code that is about to be removed soon.

Bug: 812035
Change-Id: I31e32b29908c25675a430bcaa0c30d6b7d1f7ee1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2446021
Commit-Queue: John Lee <johntlee@chromium.org>
Auto-Submit: dpapad <dpapad@chromium.org>
Reviewed-by: default avatarJohn Lee <johntlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814320}
parent a2beeed2
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
} }
:host([enforced_]) { :host([enforced_]) {
/* Disable pointer events for this whole element, as outer on-tap gets /* Disable pointer events for this whole element, as outer on-click gets
* triggered when clicking/tapping anywhere in :host. */ * triggered when clicking anywhere in :host. */
pointer-events: none; pointer-events: none;
} }
cr-policy-pref-indicator { cr-policy-pref-indicator {
/* Enable pointer events for the indicator so :hover works. Disable /* Enable pointer events for the indicator so :hover works. Disable
* clicks/taps via onIndicatorTap_ so outer on-tap doesn't trigger. */ * clicks via onIndicatorClick_ so outer on-click doesn't trigger. */
pointer-events: all; pointer-events: all;
} }
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</cr-button> </cr-button>
<template is="dom-if" if="[[hasPrefPolicyIndicator(pref.*)]]" restamp> <template is="dom-if" if="[[hasPrefPolicyIndicator(pref.*)]]" restamp>
<cr-policy-pref-indicator pref="[[pref]]" on-click="onIndicatorTap_" <cr-policy-pref-indicator pref="[[pref]]" on-click="onIndicatorClick_"
icon-aria-label="[[label]]"> icon-aria-label="[[label]]">
</cr-policy-pref-indicator> </cr-policy-pref-indicator>
</template> </template>
......
...@@ -52,7 +52,7 @@ Polymer({ ...@@ -52,7 +52,7 @@ Polymer({
* @param {!Event} e * @param {!Event} e
* @private * @private
*/ */
onIndicatorTap_(e) { onIndicatorClick_(e) {
// Disallow <controlled-button on-click="..."> when controlled. // Disallow <controlled-button on-click="..."> when controlled.
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
......
...@@ -22,28 +22,28 @@ ...@@ -22,28 +22,28 @@
<cr-policy-indicator indicator-type="[[getPolicyIndicatorType_(model)]]"> <cr-policy-indicator indicator-type="[[getPolicyIndicatorType_(model)]]">
</cr-policy-indicator> </cr-policy-indicator>
<cr-icon-button class="icon-more-vert" id="dots" <cr-icon-button class="icon-more-vert" id="dots"
title="[[i18n('moreActions')]]" on-click="onDotsTap_"> title="[[i18n('moreActions')]]" on-click="onDotsClick_">
</cr-icon-button> </cr-icon-button>
<cr-lazy-render id="menu"> <cr-lazy-render id="menu">
<template> <template>
<cr-action-menu role-description="[[i18n('menu')]]"> <cr-action-menu role-description="[[i18n('menu')]]">
<button class="dropdown-item" id="view" <button class="dropdown-item" id="view"
on-tap="onViewTap_"> on-click="onViewClick_">
[[i18n('certificateManagerView')]] [[i18n('certificateManagerView')]]
</button> </button>
<button class="dropdown-item" id="edit" <button class="dropdown-item" id="edit"
hidden$="[[!canEdit_(model)]]" hidden$="[[!canEdit_(model)]]"
on-tap="onEditTap_"> on-click="onEditClick_">
[[i18n('edit')]] [[i18n('edit')]]
</button> </button>
<button class="dropdown-item" id="export" <button class="dropdown-item" id="export"
hidden$="[[!canExport_(certificateType, model)]]" hidden$="[[!canExport_(certificateType, model)]]"
on-tap="onExportTap_"> on-click="onExportClick_">
[[i18n('certificateManagerExport')]] [[i18n('certificateManagerExport')]]
</button> </button>
<button class="dropdown-item" id="delete" <button class="dropdown-item" id="delete"
hidden$="[[!canDelete_(model)]]" hidden$="[[!canDelete_(model)]]"
on-tap="onDeleteTap_"> on-click="onDeleteClick_">
[[i18n('certificateManagerDelete')]] [[i18n('certificateManagerDelete')]]
</button> </button>
</cr-action-menu> </cr-action-menu>
......
...@@ -79,38 +79,26 @@ Polymer({ ...@@ -79,38 +79,26 @@ Polymer({
this.fire('certificates-error', {error: error, anchor: this.$.dots}); this.fire('certificates-error', {error: error, anchor: this.$.dots});
}, },
/** /** @private */
* @param {!Event} event onViewClick_() {
* @private
*/
onViewTap_(event) {
this.closePopupMenu_(); this.closePopupMenu_();
this.browserProxy_.viewCertificate(this.model.id); this.browserProxy_.viewCertificate(this.model.id);
}, },
/** /** @private */
* @param {!Event} event onEditClick_() {
* @private
*/
onEditTap_(event) {
this.closePopupMenu_(); this.closePopupMenu_();
this.dispatchCertificateActionEvent_(CertificateAction.EDIT); this.dispatchCertificateActionEvent_(CertificateAction.EDIT);
}, },
/** /** @private */
* @param {!Event} event onDeleteClick_() {
* @private
*/
onDeleteTap_(event) {
this.closePopupMenu_(); this.closePopupMenu_();
this.dispatchCertificateActionEvent_(CertificateAction.DELETE); this.dispatchCertificateActionEvent_(CertificateAction.DELETE);
}, },
/** /** @private */
* @param {!Event} event onExportClick_() {
* @private
*/
onExportTap_(event) {
this.closePopupMenu_(); this.closePopupMenu_();
if (this.certificateType === CertificateType.PERSONAL) { if (this.certificateType === CertificateType.PERSONAL) {
this.browserProxy_.exportPersonalCertificate(this.model.id).then(() => { this.browserProxy_.exportPersonalCertificate(this.model.id).then(() => {
...@@ -158,7 +146,7 @@ Polymer({ ...@@ -158,7 +146,7 @@ Polymer({
}, },
/** @private */ /** @private */
onDotsTap_() { onDotsClick_() {
const actionMenu = /** @type {!CrActionMenuElement} */ (this.$.menu.get()); const actionMenu = /** @type {!CrActionMenuElement} */ (this.$.menu.get());
actionMenu.showAt(this.$.dots); actionMenu.showAt(this.$.dots);
}, },
......
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
:host([disabled]) { :host([disabled]) {
opacity: var(--cr-disabled-opacity); opacity: var(--cr-disabled-opacity);
/* Disable pointer events for this whole element, as outer on-tap gets /* Disable pointer events for this whole element, as outer on-click gets
* triggered when clicking/tapping anywhere in :host. */ * triggered when clicking anywhere in :host. */
pointer-events: none; pointer-events: none;
} }
......
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