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

Side by Side Diff: tracing/tracing/ui/base/dropdown.html

Issue 1967613003: Migrate child element manipulation, innerHTML, classList, attributes, (Closed) Base URL: https://github.com/catapult-project/catapult.git@polymer10-migration
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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright (c) 2015 The Chromium Authors. All rights reserved. 3 Copyright (c) 2015 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/base/base.html"> 8 <link rel="import" href="/tracing/base/base.html">
9 9
10 <dom-module id='tr-ui-b-dropdown'> 10 <dom-module id='tr-ui-b-dropdown'>
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 if (!this.isOpen) 111 if (!this.isOpen)
112 this.show(); 112 this.show();
113 else 113 else
114 this.close(); 114 this.close();
115 }, 115 },
116 116
117 show: function() { 117 show: function() {
118 if (this.isOpen) 118 if (this.isOpen)
119 return; 119 return;
120 120
121 this.$.outer.classList.add('open'); 121 Polymer.dom(this.$.outer).classList.add('open');
122 122
123 var ddr = this.$.outer.getBoundingClientRect(); 123 var ddr = this.$.outer.getBoundingClientRect();
124 var rW = Math.max(ddr.width, 150); 124 var rW = Math.max(ddr.width, 150);
125 this.$.dialog.style.minWidth = rW + 'px'; 125 this.$.dialog.style.minWidth = rW + 'px';
126 this.$.dialog.showModal(); 126 this.$.dialog.showModal();
127 127
128 var ddw = this.$.outer.getBoundingClientRect().width; 128 var ddw = this.$.outer.getBoundingClientRect().width;
129 var w = this.$.dialog.getBoundingClientRect().width; 129 var w = this.$.dialog.getBoundingClientRect().width;
130 this.$.dialog.style.top = ddr.bottom - 1 + 'px'; 130 this.$.dialog.style.top = ddr.bottom - 1 + 'px';
131 this.$.dialog.style.left = ddr.left + 'px'; 131 this.$.dialog.style.left = ddr.left + 'px';
(...skipping 10 matching lines...) Expand all
142 142
143 onDialogCancel_: function(e) { 143 onDialogCancel_: function(e) {
144 e.preventDefault(); 144 e.preventDefault();
145 this.close(); 145 this.close();
146 }, 146 },
147 147
148 close: function() { 148 close: function() {
149 if (!this.isOpen) 149 if (!this.isOpen)
150 return; 150 return;
151 this.$.dialog.close(); 151 this.$.dialog.close();
152 this.$.outer.classList.remove('open'); 152 Polymer.dom(this.$.outer).classList.remove('open');
153 this.$.outer.focus(); 153 this.$.outer.focus();
154 }, 154 },
155 155
156 get isOpen() { 156 get isOpen() {
157 return this.$.dialog.hasAttribute('open'); 157 return this.$.dialog.hasAttribute('open');
158 } 158 }
159 }); 159 });
160 </script> 160 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698