Lines Matching full:overlay
10 * You can turn any div into an overlay. Note that while an
11 * overlay element is shown, its parent is changed. Hiding the overlay
28 this.classList.add('overlay-root');
45 * Adds an overlay, attaching it to the contentHost so that it is visible.
47 showOverlay: function(overlay) {
48 // Reparent this to the overlay content host.
49 overlay.oldParent_ = overlay.parentNode;
50 this.contentHost.appendChild(overlay);
53 // Show the overlay root.
54 this.ownerDocument.body.classList.add('disabled-by-overlay');
57 // Bring overlay into focus.
58 overlay.tabIndex = 0;
59 overlay.focus();
62 // leaving the overlay.
65 overlay.addEventListener('keydown', this.onKeydownBoundToThis_);
69 * Clicking outside of the overlay will de-focus the overlay. The
72 * the overlay.
81 * Prevents forward-tabbing out of the overlay
94 * Prevent the user from shift-tabbing backwards out of the overlay.
105 * Hides an overlay, attaching it to its original parent if needed.
107 hideOverlay: function(overlay) {
108 // hide the overlay root
110 this.ownerDocument.body.classList.remove('disabled-by-overlay');
113 // put the overlay back on its previous parent
114 overlay.parentNode.removeChild(this.tabCatcher);
115 if (overlay.oldParent_) {
116 overlay.oldParent_.appendChild(overlay);
117 delete overlay.oldParent_;
119 this.contentHost.removeChild(overlay);
123 overlay.removeEventListener('keydown', this.onKeydownBoundToThis_);
132 * Creates a new overlay element. It will not be visible until shown.
137 var Overlay = cr.ui.define('div');
139 Overlay.prototype = {
143 * Initializes the overlay element.
146 // create the overlay root on this document if its not present
147 if (!this.ownerDocument.querySelector('.overlay-root')) {
153 this.classList.add('overlay');
158 var overlayRoot = this.ownerDocument.querySelector('.overlay-root');
168 * Shows and hides the overlay. Note that while visible == true, the overlay
171 cr.defineProperty(Overlay, 'visible', cr.PropertyKind.BOOL_ATTR,
172 Overlay.prototype.onVisibleChanged_);
175 Overlay: Overlay