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

Unified Diff: third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-manager-extracted.js

Issue 1984963002: Roll Polymer elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-manager-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-manager-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-manager-extracted.js
index 40af738a3ace60b5f8a896f313ab265e91642c8b..dc46523f23206eda72c222635f73a20f970e4d21 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-manager-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-manager-extracted.js
@@ -23,10 +23,10 @@
*/
this._backdropElement = null;
- // Listen to mousedown or touchstart to be sure to be the first to capture
- // clicks outside the overlay.
- var clickEvent = ('ontouchstart' in window) ? 'touchstart' : 'mousedown';
- document.addEventListener(clickEvent, this._onCaptureClick.bind(this), true);
+ // Enable document-wide tap recognizer.
+ Polymer.Gestures.add(document, 'tap', null);
+ // Need to have useCapture=true, Polymer.Gestures doesn't offer that.
+ document.addEventListener('tap', this._onCaptureClick.bind(this), true);
document.addEventListener('focus', this._onCaptureFocus.bind(this), true);
document.addEventListener('keydown', this._onCaptureKeyDown.bind(this), true);
};
@@ -106,7 +106,6 @@
} else {
this.removeOverlay(overlay);
}
- this.trackBackdrop();
},
/**
@@ -118,6 +117,7 @@
var i = this._overlays.indexOf(overlay);
if (i >= 0) {
this._bringOverlayAtIndexToFront(i);
+ this.trackBackdrop();
return;
}
var insertionIndex = this._overlays.length;
@@ -144,6 +144,7 @@
// Get focused node.
var element = this.deepActiveElement;
overlay.restoreFocusNode = this._overlayParent(element) ? null : element;
+ this.trackBackdrop();
},
/**
@@ -162,6 +163,7 @@
if (node && Polymer.dom(document.body).deepContains(node)) {
node.focus();
}
+ this.trackBackdrop();
},
/**
@@ -330,12 +332,6 @@
var overlay = /** @type {?} */ (this.currentOverlay());
// Check if clicked outside of top overlay.
if (overlay && this._overlayInPath(Polymer.dom(event).path) !== overlay) {
- if (overlay.withBackdrop) {
- // There's no need to stop the propagation as the backdrop element
- // already got this mousedown/touchstart event. Calling preventDefault
- // on this event ensures that click/tap won't be triggered at all.
- event.preventDefault();
- }
overlay._onCaptureClick(event);
}
},

Powered by Google App Engine
This is Rietveld 408576698