polymer

Why does core-list doesn't set a height within a core-header-panel?

血红的双手。 提交于 2019-12-10 21:07:15
问题 I've tried to put a <core-list> into a <core-header-panel> but the core-list is not rendered until I give it a height. So my example code does work with a very silly hack, but I think there must be better way to fit the core-list into the page. The structure is as follows: Here's my code: JSFiddle: http://jsfiddle.net/gu0g8kt3/2/ HTML <link rel="import" href="http://www.polymer-project.org/components/polymer/polymer.html"> <link rel="import" href="http://www.polymer-project.org/components

Using Google Web Components elements in polymer 3

一世执手 提交于 2019-12-10 19:53:29
问题 How can we install Google Web Components elements in polymer 3 Example - using google-youtube or many more elements can't support npm install yet! https://www.webcomponents.org/element/GoogleWebComponents/google-youtube Is anyone figured out installing this for polymer 3. 回答1: You could try to install it will polymer modulizer npm install -g polymer-modulizer you'll need to have bower installed as well, then in your repo you can run modulizer GoogleWebComponents/google-youtube that will

Using Polymer to include jQuery via HTML Imports not working in Safari and Firefox

若如初见. 提交于 2019-12-10 19:17:30
问题 I tried to include jQuery in the main page via HTML Imports, but it only worked in Chrome. Both Safari and Firefox threw a "ReferenceError: $ is not defined" message on the first line of the JavaScript code in the main page. It appeared that the JavaScript code on the page was executed before the jQuery object was loaded in Safari or Firefox. I was using the latest versions of Polymer(0.4) and jQuery (2.1.1). Below is a minimal example: jquery.html <script src="https://code.jquery.com/jquery

Polymer 1.0 - Issue with displaying values inside template is=“dom-repeat”

无人久伴 提交于 2019-12-10 19:01:54
问题 While migrating to Polymer 1.0 from 0.5 I have come across an interesting thing. Thought it might help others having similar problem. I have an element where I am using <template is="dom-repeat" items="{{customers}}">...</template> . The problem I am facing is I have to place every single property binding inside a HTML element. The code below what I intended to write: <template is="dom-repeat" items="{{customers}}"> <div> {{item.name}}<br /> {{item.addr}}, {{item.addr2}}<br /> {{item.phone}}

Paper-fab partially hides behind app-toolbar

試著忘記壹切 提交于 2019-12-10 18:56:25
问题 I want to import an element that contains a paper-fab and have the paper-fab overlap the seam between the app-header element and the imported element. (In this case, I'm calling the imported element a fab-element ). In other words, I simply want the paper-fab to "float" (as advertised and like it's supposed to). What I expect it to look like: jsBin What it actually looks like: FAB inside app-toolbar . (works) Click here for jsBin. FAB outside app-toolbar but inside app-header . (works) Click

How to generate DOM nodes with valueless attributes

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 17:26:03
问题 I'm trying to generate nodes like this: <div layout horizontal></div> using DOM API. I'm trying something like this: var d = document.createElement("div"); d.setAttribute(...); but never really managed to generate what I want. Any ideas how to do this? Thanks. 回答1: The subject of your question reflects the basic confusion here. There is no such things as a "valueless attribute". There is merely a syntactic convenience available in HTML to write an attribute with no specific value, in cases

What is the difference between `HTMLImports.whenReady` and `window.addEventListener('WebComponentsReady', function(e) {`

耗尽温柔 提交于 2019-12-10 17:15:31
问题 What is the difference between HTMLImports.whenReady and window.addEventListener('WebComponentsReady', function(e) { ? Polymer's official documentation says: "To define an element in your main HTML document, define the element from HTMLImports.whenReady(callback). callback is invoked when all imports in the document have finished loading." Webcomponents.org's official documentation on imports says: Under native imports, tags in the main document block the loading of imports. This is to ensure

typeError: Failed to execute 'contains' on 'Node': parameter 1 is not of type 'Node Polymer

纵饮孤独 提交于 2019-12-10 16:59:35
问题 I am trying to implement context menu using polymer paper menu. Whenever I remove node from dom. polymer is throwing error like this typeError: Failed to execute 'contains' on 'Node': parameter 1 is not of type 'Node' and I get the following error message: What shall I do? 回答1: I had the same issue. This is due to polymer-mini.html checks if the arg passed to document.documentElement.contains( node ) is node type. Debugging i could see that an event propagated so the last iteration was window

Could not run a simple polymer app

穿精又带淫゛_ 提交于 2019-12-10 16:02:49
问题 OK.. I have configured Polymer Project as it is in This Video Project structure is : My custom element is : <link rel="import" href="../bower_components/polymer/polymer.html"> <polymer-element name="hello-world" noscript> <template> <h1>Hi From Custom Element</h1> </template> </polymer-element> index.html is : <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Title of the document</title> <script type="text/javascript" src="bower_components/polymer/polymer.js"> </script> <link rel=

Polymer 0.8 “Uncaught ReferenceError: Polymer is not defined”

好久不见. 提交于 2019-12-10 15:59:56
问题 Recently I made the decision test out Polymer 0.8 rather than just read about it, however I've come across an error: "Uncaught ReferenceError: Polymer is not defined". I have a feeling it's something really simple that I've missed I can't seem to figure it out. Below is my code which I've literally copied and pasted from the feature overview document: <script src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script> <dom-module id="element-name"> <style> /* CSS rules for your