polymer

Polymer not removing deleted element

半腔热情 提交于 2019-12-12 03:07:23
问题 Using the Polymer Stater Kit, I created two custom elements : flow-list.html (here is declared the flowElementArray ) flow-element.html (here is defined the delete function) In the app.js file, I also defined a addElement function. I can add elements to the flowElementArray , and they are displayed. BUT, when I remove elements from the flowElementArray , they are still displayed. Here is how I got the following result : App start (2 items pre-loaded) I delete one item (the item stays on the

Scroll to bottom automatically using vanilla Javascript/CSS - Polymer

萝らか妹 提交于 2019-12-12 03:04:53
问题 I don't want to use JQuery to do this. Currently, I've created a listview using Polymer. I'm using <template is="dom-repeat"> inside a parent div with a class of list . The CSS is as follows. As I add new items to the list, I would like the list to scroll to the bottom automatically. Is that possible? .list { @apply(--layout-flex); @apply(--layout-vertical); position: relative; overflow: auto; } 回答1: You can set the div 's scrollTop to scrollHeight in order to automatically scroll to the

PolymerElements iron-ajax not posting data

大城市里の小女人 提交于 2019-12-12 02:57:45
问题 This here is my iron-ajax element inside a dom-module: This here is my javascript: var iron_ajax = document.querySelector('iron-ajax'); iron_ajax.body = {"full_names":profile.getName(),"access_token":googleUser.getAuthResponse().id_token}; iron_ajax.generateRequest(); When I grab the $_POST variable and dump the contents to a file (after encoding them as json) I get [] (That means no data, zero, nothing). When I .log() the variables before sending them to ensure I'm not sending blanks, the

Polymer 1.x + Firebase == Hello world?

社会主义新天地 提交于 2019-12-12 02:55:41
问题 I want to make Hello, world with the Polymer firebase-collection element. I expect to see one or more repetitions of Hello, world and no errors in the console. Instead, I see no Hello, world and many console errors beginning with: console.log ReferenceError: Firebase is not defined To recreate the problem, follow these steps: Open this jsBin. ❌ Observe no Hello, world and errors in the console. Notice the <firebase-collection> code is simply a copy/paste from the official documentation

Polymer 1.0 paper-radio-group selection - how to get selected item

雨燕双飞 提交于 2019-12-12 02:45:58
问题 I have tried this solution but seems like it is doing nothing for me. I have Polymer 1.0. Only change I made from the solution is to put the observers inside data property and made is "not protected". I got this idea from here. Initially I used the exact approach as in Ricky's solution but that didn't work for me either. Here is how my custom element looks like: <dom-module id="radio-group-binder"> <template> <paper-radio-group class="layout vertical" selected-item="[[selectedItem]]">

How to use CSS mixins with Angular 2, Dart and Polymer

人盡茶涼 提交于 2019-12-12 02:15:18
问题 I'm using polymer and polymer_elements in my angular2-dart project. I'm able to add polymer elements (such as paper-card), but I'm not able to use css-mixins, I don't know if I missing an import or something. My .dart import 'package:angular2/core.dart'; //Polymer imports import 'package:polymer_elements/paper_card.dart'; import 'package:polymer_elements/paper_button.dart'; import 'package:polymer_elements/paper_icon_button.dart'; import 'package:polymer_elements/iron_icon.dart'; import

How to keep focus on custom Polymer element when interacting with focusable elements contained within it?

亡梦爱人 提交于 2019-12-12 01:55:38
问题 I have created a custom Polymer element which extends paper-fab. The element contains other elements such as paper-button and paper-input within it. These elements are initially hidden meaning, you just see a FAB. With the custom element implemented on a different page, when it is clicked it gains focus therefore the custom element changes shape from a circle to a rectangle and shows the paper-button and paper-input elements within it. When you click away from the custom element such as on a

Link in paper-item inside paper-menu-button

自闭症网瘾萝莉.ら 提交于 2019-12-12 01:45:52
问题 I'm trying to build a little Flask project using Polymer. I don't think the flask aspect is messing with me. When I click on the 'Edit Species' paper-item I don't go anywhere. <body> <core-header-panel flex> <core-toolbar class="medium-tall"> <paper-menu-button icon="menu"> <paper-item label="Home" center horizontal layout flex></paper-item> <paper-item label="Edit Species" center horizontal layout flex> <a href="/speciesEdit"></a> </paper-item> ...more... </paper-menu-button> ...and so on...

Forcing the core-drawer-panel to be closed on startup

我们两清 提交于 2019-12-12 01:36:06
问题 I'm using core-drawer-panel to show a left-hand menu and right-hand content. I want the menu to be closed when I open the page by default. I tried setting responsiveWidth to 9999px, which works, but the drawer is quickly shown, then hidden, every time I go to the page. Is there a style I can apply or JS I can run before polymer is "stable" to get it to hide the menu? 回答1: Ah, this is fixed in 0.2.4: https://github.com/Polymer/core-drawer-panel/commit/68a2fc20235d5dad52cee806d29a76d9627b0ab8

How to make onchange event in Polymer

旧巷老猫 提交于 2019-12-12 01:27:34
问题 I'm getting this message TypeError: document.addEventListener(...) is not a function (document.addEventListener('polymer-ready',function($){ console.log('ready') // top link $.each(decodeURI(location.pathname).split('/'), function() { $("#self").html(this+''); }); // browser default lang default_lang = navigator.language /* Mozilla */ || navigator.userLanguage /* IE */; // does URL contain lang=xx ? $.each(decodeURI(location.search.substr(1)).split('&'), function() { var s = this.split('=');