polymer-1.0

Polymer <paper-drawer-panel> nest 'drawer' inside 'main'

别来无恙 提交于 2020-01-16 05:23:04
问题 Alright, so as I see it, the proper element nesting for paper-drawer-panel should be something like this: <paper-drawer-panel> <paper-header-panel drawer> <!-- Side bar content --> <paper-menu>......</paper-menu> </paper-header-panel> <paper-scroll-header-panel main> <paper-toolbar class="tall"> </paper-toolbar> <div class="main-content"> <!-- Main app body content here --> </div> <!-- Main body content --> </paper-drawer-panel> The above hierarchy will give you something like this (current

Can't get website image

隐身守侯 提交于 2020-01-16 04:32:20
问题 I am using PhantomJS to capture an image of a website built using Polymer. Here is my capture.js file: var page = require('webpage').create(); page.open('https://www.gosizzle.io/token/recruiting/957e73c45b55129b1a', function() { page.render('test1.png'); phantom.exit(); }); However when I run phantomjs capture.js my test1.png only contains the footer of the website: 来源: https://stackoverflow.com/questions/35610392/cant-get-website-image

paper-ripple mouseDown event handler downAction Override

爱⌒轻易说出口 提交于 2020-01-16 03:41:23
问题 Polymer 1.1 In paper ripple source code they have the mouseDown event handler: /** @param {Event=} event */ downAction: function(event) { var xCenter = this.containerMetrics.width / 2; var yCenter = this.containerMetrics.height / 2; In documentation it states: paper-ripple listens to "mousedown" and "mouseup" events so it would display ripple effect when touches on it. You can also defeat the default behavior and manually route the down and up actions to the ripple element However, in my

polymer 1.0 how to central justify the paper-card heading?

六眼飞鱼酱① 提交于 2020-01-13 06:33:25
问题 I am trying this to central justify the paper card heading: paper-card [heading]{ @apply(--center-justified); } but it does not seem to help. kindly suggest 回答1: heading is not an attribute so you cannot write like that. You basically need to style the .title-text element inside the shadow dom, so use this instead - paper-card::shadow #shadow .header .title-text { display: flex; justify-content: center; } Or use the polymer iron-flex-layout - paper-card::shadow #shadow .header .title-text {

Polymer 1.0 cannot find events for paper-menu or paper-item

左心房为你撑大大i 提交于 2020-01-12 07:44:29
问题 Upgrading to Polymer 1.0, How do I listen/capture to change in "focusedItem" of iron-menu-behaviour? I cannot see any event or property change listener for an item change i.e. change in paper-item selection within a paper-menu. I cannot see any such events here: https://elements.polymer-project.org/elements/iron-menu-behavior?active=Polymer.IronMenuBehavior 回答1: I have not been able to find any documentation on this just yet (perhaps someone else may have better luck), but the events you are

Get multiple values of selected paper-radio-button

前提是你 提交于 2020-01-07 06:57:08
问题 I have a dom-repeat element that creates a paper-radio-group with a couple of paper-radio-buttons. These radio-buttons each contains two pieces of unique information loaded from an array. Model name and price. I need to be able to load the model name and price of the selected radio-button. I'm able to load the name of the selected model but I can't figure out how to do it with the price at the same time. Here is the code I currently have that displays the name: <paper-radio-group class=

Polymer 1.x: How to use dataSource function to filter iron-data-table?

强颜欢笑 提交于 2020-01-07 05:43:09
问题 Here is the Plunk. I want to implement the dataSource filtering function for <iron-data-table as described in the accepted answer to this SO question. My problem is the docs here do not give an example of how to accomplish this. Eventually, I will want to have a complex set of filters (think: control panel ) on a large data set of items. I have tried copying the approach employed by dom-repeat described in the docs here but without success. http://plnkr.co/edit/cGykY65HWnK4pIQ0qx8O?p=preview

Polymer 1.x: How to reverse order of records returned by <firebase-collection>

天涯浪子 提交于 2020-01-07 05:05:11
问题 How do I reverse the order of records returned by <firebase-collection> as follows: <firebase-collection id="foo" order-by-child="bar"> ? Can I do it declaratively? Or do I need to call an imperative method like maybe... this.$.foo = this.$.foo.reverse(); https://elements.polymer-project.org/elements/firebase-element?active=firebase-collection Note: I'm using <iron-list> and not <template is="dom-repeat"> . 回答1: Simplest is just to use a <dom-repeat> with an inverse sort I believe. sort.

Polymer 1.0 App-Drawer - Uncaught TypeError when not rendered via dom-if

蓝咒 提交于 2020-01-07 02:01:32
问题 Displaying the menu only to members I've got this bit of code <app-drawer-layout fullbleed> <!-- Drawer content --> <template is="dom-if" if="{{signedIn}}"> <app-drawer> .... This displays the menu only when users are logged in to the application. It works fine but is there anyway to remove the error it causes in the console. error: polymer-mini.html:2046 Uncaught TypeError: Cannot read property 'getWidth' of undefined 回答1: The layout logic in <app-drawer-layout> requires an <app-drawer> to

Polymer 1.0 dom-repeat with Google Maps

妖精的绣舞 提交于 2020-01-06 15:18:42
问题 I am using the latest App Toolbox and app shell structure for my polymer 1.0 project and I am having issues with a dom-repeat template in a custom element, the google-map-markers are not showing up inside the dom-repeat template. Here is the code: <dom-module ="sample-map"> <style> :host { display: block; padding: 10px; } #mapWrapper{ height: 600px; display:block; width: auto; } </style> <template> <google-map api-key="MY_API_KEY" fit-to-markers> <template is="dom-repeat" items="{{locations}}