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

Side by Side Diff: third_party/polymer/v0_8/components-chromium/iron-overlay-behavior/iron-overlay-backdrop-extracted.js

Issue 1162563004: Upgrade to 1.0 and switch clients to dom-repeat where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a layout import and remove the gzipped webanimation in reproduce.sh Created 5 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1
2
3 (function() {
4
5 Polymer({
6
7 is: 'iron-overlay-backdrop',
8
9 properties: {
10
11 /**
12 * Returns true if the backdrop is opened.
13 */
14 opened: {
15 readOnly: true,
16 reflectToAttribute: true,
17 type: Boolean,
18 value: false
19 },
20
21 _manager: {
22 type: Object,
23 value: Polymer.IronOverlayManager
24 }
25
26 },
27
28 /**
29 * Appends the backdrop to document body and sets its `z-index` to be below the latest overlay.
30 */
31 prepare: function() {
32 if (!this.parentNode) {
33 Polymer.dom(document.body).appendChild(this);
34 this.style.zIndex = this._manager.currentOverlayZ() - 1;
35 }
36 },
37
38 /**
39 * Shows the backdrop if needed.
40 */
41 open: function() {
42 // only need to make the backdrop visible if this is called by the first o verlay with a backdrop
43 if (this._manager.getBackdrops().length < 2) {
44 this._setOpened(true);
45 }
46 },
47
48 /**
49 * Hides the backdrop if needed.
50 */
51 close: function() {
52 // only need to make the backdrop invisible if this is called by the last overlay with a backdrop
53 if (this._manager.getBackdrops().length < 2) {
54 this._setOpened(false);
55 }
56 },
57
58 /**
59 * Removes the backdrop from document body if needed.
60 */
61 complete: function() {
62 // only remove the backdrop if there are no more overlays with backdrops
63 if (this._manager.getBackdrops().length === 0 && this.parentNode) {
64 Polymer.dom(this.parentNode).removeChild(this);
65 }
66 }
67
68 });
69
70 })();
71
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698