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

Unified Diff: appengine/sheriff_o_matic/ui/ct-popup-menu.html

Issue 1315693002: SoM: upgrade Polymer from 0.5 to 1.0 Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: get bower_components from polymer_1.0.4 Created 5 years, 4 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: appengine/sheriff_o_matic/ui/ct-popup-menu.html
diff --git a/appengine/sheriff_o_matic/ui/ct-popup-menu.html b/appengine/sheriff_o_matic/ui/ct-popup-menu.html
index 9dadef98bee4e969bb48efdb2755e162ca545ca6..68545c8d2d06d0d0fc77713658796e75776a244d 100644
--- a/appengine/sheriff_o_matic/ui/ct-popup-menu.html
+++ b/appengine/sheriff_o_matic/ui/ct-popup-menu.html
@@ -2,13 +2,11 @@
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
--->
-<link href="../bower_components/polymer/polymer.html" rel="import">
-<link href="../bower_components/core-icon/core-icon.html" rel="import">
+--><html><head><link href="../bower_components/polymer/polymer.html" rel="import">
+<link href="../bower_components/iron-icon/iron-icon.html" rel="import">
-<polymer-element name="ct-popup-menu" attributes="{{ icon }}">
- <template>
- <style>
+<dom-module id="ct-popup-menu">
+ <style>
:host {
display: inline-block;
}
@@ -28,38 +26,42 @@ found in the LICENSE file.
visibility: hidden; /* Necessary to avoid eating clicks. */
}
</style>
- <core-icon id="icon" src="{{ src }}" icon="{{ icon }}" on-click="{{ _toggleAction }}"></core-icon>
+ <template>
+ <iron-icon id="icon" src="{{ src }}" icon="{{ icon }}" on-click=" _toggleAction "></iron-icon>
<div id="menu" class="hidden">
<content></content>
</div>
</template>
<script>
- (function() {
- Polymer({
- attached: function() {
- // FIXME: hitting escape should also hide the menu.
- document.body.addEventListener('click', this._handleClick.bind(this), true)
- },
-
- detached: function() {
- document.body.removeEventListener('click', this._handleClick.bind(this), true)
- },
-
- _toggleAction: function() {
- this.$.menu.classList.toggle('hidden');
- },
-
- _handleClick: function(event) {
- if (this.$.menu.classList.contains('hidden'))
- return;
- for (var i = event.path.length - 1; i >= 0; i--) {
- if (event.path[i] === this)
+ (function () {
+ Polymer({
+ is: 'ct-popup-menu',
+ properties: {
+ icon: { notify: true },
+ {{: { notify: true },
+ }}: { notify: true }
+ },
+ attached: function () {
+ // FIXME: hitting escape should also hide the menu.
+ document.body.addEventListener('click', this._handleClick.bind(this), true);
+ },
+ detached: function () {
+ document.body.removeEventListener('click', this._handleClick.bind(this), true);
+ },
+ _toggleAction: function () {
+ this.$.menu.classList.toggle('hidden');
+ },
+ _handleClick: function (event) {
+ if (this.$.menu.classList.contains('hidden'))
return;
+ for (var i = event.path.length - 1; i >= 0; i--) {
+ if (event.path[i] === this)
+ return;
+ }
+ event.preventDefault();
+ this.$.menu.classList.add('hidden');
}
- event.preventDefault();
- this.$.menu.classList.add('hidden');
- },
- });
- })();
+ });
+ }());
</script>
-</polymer-element>
+</dom-module>
« no previous file with comments | « appengine/sheriff_o_matic/ui/ct-popout-iframe.html ('k') | appengine/sheriff_o_matic/ui/ct-results-by-builder.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698