polymer

Polymer paper-dropdown-menu not rendered correctly in browser

╄→гoц情女王★ 提交于 2019-12-12 14:26:09
问题 I am having an issue with the rendered html for a simple paper-dropdown-menu. The list items do not appear as a styled "menu", but rather just a list of items appearing on the page. Clicking the rendered paper-input component (part of the rendered dropdown) does animate the ripple, but does not animate the show/hide of the menu and menu items. Clicking an item in the list causes the list to disappear, but clicking the dropdown again does not make the list re-appear. After examining the

Polymer paper ripple

北慕城南 提交于 2019-12-12 14:18:40
问题 I am trying to change the color of an element when a button is pressed. I want a paper ripple effect to be triggered in that element when the button is pressed and the color changes. How am I supposed to do that? Target element: <paper-toolbar class="abc"> <paper-icon-button icon="menu" paper-drawer-toggle></paper-icon-button> <div flex class="indent title">Heading</div> </paper-toolbar> Trigger element: <paper-button class="def background-blue"></paper-button> <paper-button class="def

Modules in Polymer

送分小仙女□ 提交于 2019-12-12 13:16:32
问题 In my react projects I have been using ES6 modules for some time. In my react component I would use import: import {f1,f2} from "./myLib"; In my polymer component I use a script tag: <script src="./myLib.js"></script> If I'm not mistaken, these are doing two totally different things. The script tag is polluting my global namespace for the whole app. The import isn't. Question #1: Am I correct in my understanding of this? Question #2: Is there a way to get something similar in polymer? I have

Programmatically create polymer Elements in Dart

≡放荡痞女 提交于 2019-12-12 13:13:37
问题 Need add polymer paper-dropdown-menu in DOM. I try this code: makePapersElements() { List _items = new List(); for (var i = 0; i < 13; i++) { PaperItem item = new dom.Element.tag('paper-item'); item.text = i; _items.add(item); } return _items; } And add nodes in PaperListbox then in PaperDropdownMenu: List<PaperItem> items = makePapersElements(); var element = new dom.Element.tag('div'); PaperDropdownMenu dropMenu = new PaperDropdownMenu(); PaperListbox listBox = new dom.Element.tag('paper

core-scroll-header-panel + jQuery scroll

▼魔方 西西 提交于 2019-12-12 13:12:39
问题 Using Google Polymer, I am attempting to animate the scrolling of the content of my core-scroll-header-panel with little success. I attempted scroll the the <body> tag like in most classic cases: $('html, body').animate({ scrollTop: element.offset().top }, 400); Does not work. So I assumed that there is an overlaying scrollable <div> that is being generated. Yet, upon looking through the DOM and attempting the scroll on multiple elements, it had all failed. So, I decided to try the ultimate

How to skip the Shadow DOM (and use the Light DOM) instead for Polymer templates

有些话、适合烂在心里 提交于 2019-12-12 11:58:47
问题 Sometimes you may want to skip the Shadow DOM completely with Polymer. 回答1: You can force your Polymer Element's template into the Light DOM by overriding parseDeclaration on your Polymer() JS/Coffeescript declaration. Coffeescript Example: Polymer "my-element", parseDeclaration: (elementElement) -> @lightFromTemplate(@fetchTemplate(elementElement)) Of course, you have to be careful because if you have anything that belongs in the Shadow DOM (like a stylesheet) in your template, it will now

prototype.registerCallback is not a function in Polymer

感情迁移 提交于 2019-12-12 11:20:19
问题 I've try to use core-icon and layout element. When I import core-icons.html, there's some error.. Uncaught TypeError: prototype.registerCallback is not a function and there is any element display on the page. What should I do to fix it. - Using Polymer 0.9 and Elements (0.5) 回答1: Core Elements are not compatible with Polymer 0.9. Use iron-elements instead. 回答2: So I got the same error when I started using version 1.0 of Polymer. Apparently I was using old syntax. version 0.5 syntax: Polymer(

Dart Exception: Already registered (Polymer) prototype for element x

我与影子孤独终老i 提交于 2019-12-12 10:42:54
问题 I've two polymer elements that share the same dart file. In the dart file I declare both the PolymerElement classes. Until polymer 0.15.0+1 it was working fine. I've updated the project to polymer 0.15.1 and now I get this exception: Exception: Already registered (Polymer) prototype for element x Where x is the first polymer. I think the polymer transformer is trying to register it two times, the first scanning the x polymer html file, the second when scanning the other element html file. An

How to use polymer-redux with polymer-build?

夙愿已清 提交于 2019-12-12 09:07:28
问题 I've currently started a new project based on Polymer Custom Build. I've modified the project in order to add usage of polymer-redux. Since then, when trying to build a bundled project using the command gulp build , I have the following problem [unknown-polymer-behavior] - Unable to resolve behavior ReduxBehavior . Did you import it? Is it annotated with @polymerBehavior? Declaring the ReduxBehavior is done using ReduxBehavior = PolymerRedux(store); which is not very usual. Anybody succeeded

How to inject HTML into a template with Polymer 1.x?

故事扮演 提交于 2019-12-12 08:49:03
问题 A part of the template of my Polymer component is supposed to render unescaped HTML from a JSON response (yes, it's safe to do so in this case). I used juicy-html (https://github.com/Juicy/juicy-html) for this up until now, but it doesn't work anymore with Polymer 1.x. The corresponding part of my template looked pretty much like this: <template if="{{item.part1}}"> <div> <template is="juicy-html" content="{{item.part1.part2 | callFunction}}"></template> </div> </template> I read about a few