polymer

Can't style element in shadow dom in media query

三世轮回 提交于 2019-12-02 05:12:15
问题 In my styles/app-theme.html I am trying to change the menu icon size of paper-drawer-panel in the media query. This element is in index.html. Since it is in the shadow dom, I can't seem to access it. I tried with: Probably not relevant, but here is the index.html: <template is="dom-bind" id="app"> <paper-drawer-panel force-narrow="true"> <div drawer> <drawer-custom></drawer-custom> </div> <div main> <div id="header-v-center"> <paper-icon-button id="paper-toggle" icon="menu" paper-drawer

polymer error on reloading

旧时模样 提交于 2019-12-02 04:47:43
i have installed the polymer starter kit and once i load the starter kit every thing gets loaded properly and the url looks like http://127.0.0.1:8887/ then once i click on any view that page gets open and url changes to http://127.0.0.1:8887/view1 but if i reload the browser now, instead of showing the same page it displays the entry not found error.i have tried searching over internet for solution but i didn't find one.what should i do to fix it. When you refresh the page ( http://127.0.0.1:8887/view1 ) you request the view1 resource from the server, but the server can't find it because

How to display html inside template?

删除回忆录丶 提交于 2019-12-02 04:24:53
I have polymer-element: example By default templates is not allowed to insert html. This sample is not working , because it's not allowed to insert html. Maybe exists the way to do that. ebidel One way to do this is through a *Changed watcher and setting the .innerHTML the node: <div id="div"></div> labelChanged: function() { this.$.div.innerHTML = this.label; } Then, for the <template repeat> case, wrap things up in a custom element that follows the similar pattern: https://stackoverflow.com/a/22208332 . <element inner-h-t-m-l="{{prop}}"></element> works for Polymer 2. Source: https://github

Polymer 1.x: Deleting an item from iron-list

筅森魡賤 提交于 2019-12-02 03:54:51
问题 I am trying to delete an item from iron-list using the following code. my-element.html <iron-list id="list" items="[[items]]" as="item" selected-items="{{selectedItems}}" selection-enabled multi-selection> <template> <my-item item="[[item]]" on-tap="_onItemTap"></my-item> </template> </iron-list> ... _onItemTap: function(e) { this.items.splice(e.model.index, 1); } Expected behavior Tap list item List item disappears Select next list item Next list item is selected Actual behavior Tap list

Polymer (1.0) - dynamic use xlink:href$ inside template not working properly

假装没事ソ 提交于 2019-12-02 03:17:41
i have a custom footer-bar ( tabfooter ) that creates a set of buttons with inline SVG inside of it (for styling reasons its inline). I didnt want to put the complete code for all SVG into the attributes, so i just hand over some ids, which are used by the component to determine the paths on its own. <custom-tabfooter values="{" ids ":["A ","B ","C ","D "]}"></custom-tabfooter> The component then takes the object with the ID array inside and uses it for repeating the DOM elements that are needed: <dom-module id="custom-tabfooter"> <template> <template is="dom-repeat" items="{{values.ids}}">

Are there ways to display Korean, Japanese or Chinese characters on polymer paper-item?

牧云@^-^@ 提交于 2019-12-02 03:15:44
I am using polymer to develop my own app. Coz the target user are Asian, i have to use Korean, Japanese or Chinese characters. However, they are not display properly. like this Are there ways to solve this problem? Günter Zöchbauer You need to specify the encoding in the HTML file of the Polymer element. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> See also I have greek text on a String in Dart using Polymer, why is it displayed wrongly on the browser? 来源: https://stackoverflow.com/questions/35394715/are-there-ways-to-display-korean-japanese-or-chinese-characters-on

Polymer select2 element

你。 提交于 2019-12-02 02:45:03
I am attempting to wrap the great select2 jquery widget ( https://github.com/ivaynberg/select2 ) in a Polymer element for easy reuse. I was able to get the select initialized correctly, but am running into issues after initialization. Specifically, when clicking the select to open it a type error is thrown in the select2 script when positioning the pop over. Here is a repo with the failing implementation: https://github.com/ivelander/x-select2 Has anyone had good success integrating Polymer with this select2 widget or jquery widgets in general? Any suggestions on how I might get this example

event.preventDefault() is not working in IE 11 for custom events

烂漫一生 提交于 2019-12-02 02:38:56
I have a polymer element which triggers a custom event synchronously and I want to know whether the event was cancelled using event.preventDefault(). Using event.defaultPrevented I can know the intended action. This works on all browsers(Chrome, Canary, Firefox, Opera) but on IE 11 (not worried about older browsers) its not working. I know I can set some property on my event and check for that back where I am triggering and handle but want to know if there is something else which I missed. You can try out the code from http://jsbin.com/husamupi/1/edit I had the same problem and could solve it

Polymer 1.x: Deleting an item from iron-list

巧了我就是萌 提交于 2019-12-02 02:37:13
I am trying to delete an item from iron-list using the following code. my-element.html <iron-list id="list" items="[[items]]" as="item" selected-items="{{selectedItems}}" selection-enabled multi-selection> <template> <my-item item="[[item]]" on-tap="_onItemTap"></my-item> </template> </iron-list> ... _onItemTap: function(e) { this.items.splice(e.model.index, 1); } Expected behavior Tap list item List item disappears Select next list item Next list item is selected Actual behavior Tap list item List item does not disappear Select same list item (i.e., the one previously intended to be deleted)

Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry

末鹿安然 提交于 2019-12-02 02:36:41
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry at http://127.0.0.1:8000/components/@polymer/polymer/lib/elements/dom-module.js:175:16 Tried deleting node-modules and package-lock and reinstalling did not work. For those cases where it's a custom element you're registering simply check that an element by this name hasn't already been registered. Obviously you can include more complex logic to vary the name, decorate the class, etc, however this simply checks to see if something is already registered using the