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

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

Issue 1862213002: Roll third_party/polymer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove obsolete appearance_browsertest.js, result of a previous bad merge. Created 4 years, 8 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
1 (function() { 1 (function() {
2 2
3 Polymer({ 3 Polymer({
4 4
5 is: 'iron-overlay-backdrop', 5 is: 'iron-overlay-backdrop',
6 6
7 properties: { 7 properties: {
8 8
9 /** 9 /**
10 * Returns true if the backdrop is opened. 10 * Returns true if the backdrop is opened.
(...skipping 13 matching lines...) Expand all
24 }, 24 },
25 25
26 listeners: { 26 listeners: {
27 'transitionend' : '_onTransitionend' 27 'transitionend' : '_onTransitionend'
28 }, 28 },
29 29
30 /** 30 /**
31 * Appends the backdrop to document body and sets its `z-index` to be below the latest overlay. 31 * Appends the backdrop to document body and sets its `z-index` to be below the latest overlay.
32 */ 32 */
33 prepare: function() { 33 prepare: function() {
34 // Always update z-index
35 this.style.zIndex = this._manager.backdropZ();
36 if (!this.parentNode) { 34 if (!this.parentNode) {
37 Polymer.dom(document.body).appendChild(this); 35 Polymer.dom(document.body).appendChild(this);
38 } 36 }
39 }, 37 },
40 38
41 /** 39 /**
42 * Shows the backdrop if needed. 40 * Shows the backdrop if needed.
43 */ 41 */
44 open: function() { 42 open: function() {
45 // only need to make the backdrop visible if this is called by the first o verlay with a backdrop 43 // only need to make the backdrop visible if this is called by the first o verlay with a backdrop
46 if (this._manager.getBackdrops().length < 2) { 44 if (this._manager.getBackdrops().length < 2) {
47 this._setOpened(true); 45 this._setOpened(true);
48 } 46 }
49 }, 47 },
50 48
51 /** 49 /**
52 * Hides the backdrop if needed. 50 * Hides the backdrop if needed.
53 */ 51 */
54 close: function() { 52 close: function() {
55 // Always update z-index
56 this.style.zIndex = this._manager.backdropZ();
57 // close only if no element with backdrop is left 53 // close only if no element with backdrop is left
58 if (this._manager.getBackdrops().length === 0) { 54 if (this._manager.getBackdrops().length === 0) {
59 // Read style before setting opened. 55 // Read style before setting opened.
60 var cs = getComputedStyle(this); 56 var cs = getComputedStyle(this);
61 var noAnimation = (cs.transitionDuration === '0s' || cs.opacity == 0); 57 var noAnimation = (cs.transitionDuration === '0s' || cs.opacity == 0);
62 this._setOpened(false); 58 this._setOpened(false);
63 // In case of no animations, complete 59 // In case of no animations, complete
64 if (noAnimation) { 60 if (noAnimation) {
65 this.complete(); 61 this.complete();
66 } 62 }
(...skipping 12 matching lines...) Expand all
79 75
80 _onTransitionend: function (event) { 76 _onTransitionend: function (event) {
81 if (event && event.target === this) { 77 if (event && event.target === this) {
82 this.complete(); 78 this.complete();
83 } 79 }
84 } 80 }
85 81
86 }); 82 });
87 83
88 })(); 84 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698