polymer-1.0

Polymer 1.x: How to imperatively (using JS) obtain the value of a custom CSS property?

℡╲_俬逩灬. 提交于 2019-12-11 06:16:45
问题 In the following example, I have a parent custom element calling a child custom element. The child has a variable color CSS property for p elements that can be defined in the parent CSS. In the JS of the child element, I want to read the --custom-color value selected at the parent. In this case, the value is yellow . Put another way: when the getCustomColor() method is run, I want the console log to read "Your custom color is yellow." What JavaScript do I put in the getCustomColor() method to

Iroin-ajax response with html tags [duplicate]

无人久伴 提交于 2019-12-11 06:09:01
问题 This question already has answers here : How to inject HTML into a template with polymer (3 answers) Closed 3 years ago . I'm getting a JSON feed by iron-ajax, in the returned JSON come with HTML tags like this. [{ pk :1, body: "<p>ثم سكان بشرية الأبرياء عدد, كلّ يقوم الطرفين و. وبدأت انذار عل بحق, تكبّد إستيلاء الأثناء، دنو بـ, عالمية العالم، بالمطالبة قد الى. وزارة السبب التّحول فصل بل, كل والتي واشتدّت وايرلندا بعض. إحتار واندونيسيا، بلا لم, بوابة الفترة بين بل. </p> <p>ثم سكان بشرية

Polymer: Updating Templatized template when parent changes

廉价感情. 提交于 2019-12-11 05:44:13
问题 Following this question, I'm trying to get full two-way binding between parent and template when using Polymer.Templatizer. I'm not sure what the problem is _forwardParentProp and _forwardParentPath are never called when a property changes on parent. I think it's the reason why my templates don't update. Here's my code (also available here). As you can see dom-if binds both ways and the two templates (one created dynamically other declared inside custom element) only update parent but aren't

Polymer app-route query string format

柔情痞子 提交于 2019-12-11 05:29:50
问题 I replaced PageJS routing in our application with app-location and app-route , and everything seems to be working except the query parameters. I noticed it can only read URLs like host?param1=val1#/view , not host#view?param1=val1 how PageJS used to. Upon further digging, I discovered that this is actually an RFC standard. I find it odd that PageJS and Angular can use the nonstandard query string format. Is there a way to use the query-params attribute of app-route to read the nonstandard

iron-scroll-threshold is never executed after first list scolling is end in polymer

夙愿已清 提交于 2019-12-11 04:42:44
问题 I've done as follow by using iron-list and iron-scroll-threshold in order to implement infinite-scrolling in polymer. But problem is loadMoreData for iron-scroll-threshold is never executed after first list scrolling is end in polymer. Please help me which one is missing or wrong in my code. Thanks. <template> <iron-ajax id="ajax" url="https://randomuser.me/api/" handle-as="json" params='{"results": 20}' loading="{{loadingPeople}}" on-response="categoriesLoaded"> </iron-ajax> <app-toolbar>

How to get Polymer domHost property?

自作多情 提交于 2019-12-11 04:11:26
问题 I have a basic Polymer template with a very simple structure, described here: Polymer: can't get this.__data__ passing in from host (codebase is here: https://srgg6701.github.io/Polymer_template) I need to use data passed from parent to children. I can pass them and see it within this.domHost : However, if I try to get this.domHost.properties , it says undefined (!). So, two questions: Why it is undefined here? Is it possible to make this data accessible? 回答1: For Question#1: It's most likely

Is the content element used in Polymer 1.0?

情到浓时终转凉″ 提交于 2019-12-11 03:33:36
问题 https://www.polymer-project.org/1.0/docs/devguide/local-dom#dom-distribution In the above link under "Dom Distribution" it says: To support composition of an element's light DOM with its local DOM, Polymer supports the <content> element. ... Just wondering if this is out of date? Does Polymer 1.0 use slots as described here? https://developers.google.com/web/fundamentals/primers/shadowdom/?hl=en#composition_slot 回答1: It's definitely working in Polymer 1.0, even with Shadow DOM; I'm currently

How to declare and bind to properties with type=“object” in Polymer 1.0

我的梦境 提交于 2019-12-11 02:58:51
问题 I'm having an issue understanding how Polymer 1.0 handles declared properties, specifically those with the type="object". In order to figure this out I am trying to create a simple element to select a material type and display things about it. Here is what my element looks like so far <dom-module id="mat-panel"> <style> :host { background: blue; } </style> <template> <iron-selector attr-for-selected="name" selected="{{material}}"> <div name="polyester">Polyester</div> <div name="nylon">Nylon<

Data binding to a dynamic path in Polymer

自作多情 提交于 2019-12-11 01:57:19
问题 I am building a web app with Polymer 1.0 and Firebase, and I want to have the view change when data was entered into a path with a user ID in the path. To do that, I want to do something like this: [[question.answers.(user.uid).choice]] Let me explain in more detail. So, in the template, I have something like this: <ul id="question-list"> <template is="dom-repeat" items="[[questions]]" sort="_computeSort" as="question"> <li class="card question" data-key="[[question.$key]]" question="[

Prevent menu close on multi select paper-dropdown-menu. Polymer 1.0

六眼飞鱼酱① 提交于 2019-12-11 01:51:42
问题 I have implemented a multi-select drop-down menu in the snippet below. It seems to work fine. However, each time I select an item, the menu closes. I'd like the menu to stay open until the User clicks a 'done' button. Strangely enough, the menu stays open if I deselect an item, but closes if I selected an item. html, body { height: 100%; } body { overflow: hidden; margin: 0; font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial; -webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-touch