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

Unified Diff: bower_components/core-overlay/core-overlay-layer.html

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 12 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
« no previous file with comments | « bower_components/core-overlay/core-overlay.html ('k') | bower_components/core-overlay/demo.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bower_components/core-overlay/core-overlay-layer.html
diff --git a/bower_components/core-overlay/core-overlay-layer.html b/bower_components/core-overlay/core-overlay-layer.html
deleted file mode 100644
index c75ce3abd3ae78d7644937d0fb8119bdbffbdc4b..0000000000000000000000000000000000000000
--- a/bower_components/core-overlay/core-overlay-layer.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<!--
-Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
-This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
-The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
-The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
-Code distributed by Google as part of the polymer project is also
-subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--->
-
-<polymer-element name="core-overlay-layer">
-<template>
- <style>
- :host {
- position: fixed;
- top: 0;
- left: 0;
- z-index: 1000;
- display: none;
- }
-
- :host(.core-opened) {
- display: block;
- }
- </style>
- <content></content>
-</template>
-<script>
-(function() {
-
- Polymer('core-overlay-layer', {
- publish: {
- opened: false
- },
- openedChanged: function() {
- this.classList.toggle('core-opened', this.opened);
- },
- /**
- * Adds an element to the overlay layer
- */
- addElement: function(element) {
- if (!this.parentNode) {
- document.querySelector('body').appendChild(this);
- }
- if (element.parentNode !== this) {
- element.__contents = [];
- var ip$ = element.querySelectorAll('content');
- for (var i=0, l=ip$.length, n; (i<l) && (n = ip$[i]); i++) {
- this.moveInsertedElements(n);
- this.cacheDomLocation(n);
- n.parentNode.removeChild(n);
- element.__contents.push(n);
- }
- this.cacheDomLocation(element);
- this.updateEventController(element);
- var h = this.makeHost();
- h.shadowRoot.appendChild(element);
- element.__host = h;
- }
- },
- makeHost: function() {
- var h = document.createElement('overlay-host');
- h.createShadowRoot();
- this.appendChild(h);
- return h;
- },
- moveInsertedElements: function(insertionPoint) {
- var n$ = insertionPoint.getDistributedNodes();
- var parent = insertionPoint.parentNode;
- insertionPoint.__contents = [];
- for (var i=0, l=n$.length, n; (i<l) && (n=n$[i]); i++) {
- this.cacheDomLocation(n);
- this.updateEventController(n);
- insertionPoint.__contents.push(n);
- parent.appendChild(n);
- }
- },
- updateEventController: function(element) {
- element.eventController = this.element.findController(element);
- },
- /**
- * Removes an element from the overlay layer
- */
- removeElement: function(element) {
- element.eventController = null;
- this.replaceElement(element);
- var h = element.__host;
- if (h) {
- h.parentNode.removeChild(h);
- }
- },
- replaceElement: function(element) {
- if (element.__contents) {
- for (var i=0, c$=element.__contents, c; (c=c$[i]); i++) {
- this.replaceElement(c);
- }
- element.__contents = null;
- }
- if (element.__parentNode) {
- var n = element.__nextElementSibling && element.__nextElementSibling
- === element.__parentNode ? element.__nextElementSibling : null;
- element.__parentNode.insertBefore(element, n);
- }
- },
- cacheDomLocation: function(element) {
- element.__nextElementSibling = element.nextElementSibling;
- element.__parentNode = element.parentNode;
- }
- });
-
-})();
-</script>
-</polymer-element>
« no previous file with comments | « bower_components/core-overlay/core-overlay.html ('k') | bower_components/core-overlay/demo.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698