polymer

Polymer paper-dialog position

…衆ロ難τιáo~ 提交于 2019-12-21 20:02:47
问题 In my application I am using polymer's paper-dialog element. The dialog's styles always position it in the center, but I want it to have a minimum distance set between the dialog and the right side of the window, so when the window shrinks, the paper-dialog won't get closer to the right side, than the set distance. Is there any way that I can do it with CSS, or shall I use some other technic? 回答1: if you want to specified a distance between the dialog and the right side you might want to

Dynamically created html import inside a polymer element (Version 1.0)

不想你离开。 提交于 2019-12-21 19:46:27
问题 Dynamically created html import inside a polymer element Does anyone know how to dynamically add a html import into a polymer element (version 1.0)? The code below doesn't seem to work and complains that the.. HTML element <link> is ignored in shadow tree. Does anyone know any way around this or know a better way? <!-- here is where the created import could go --> <dom-module id="my-component"> <!-- here is where I'd ideally like the import to be created --> <template> <div id="container"> <!

How to deploy a Dart Polymer app to Javascript using dart2js

南楼画角 提交于 2019-12-21 19:46:23
问题 I got a problem while deploying Dart code using Polymer to Javascript. I've created a polymer application with DartEditor and made a simple example. This example works in Dartium but when I try to build it as a Polymer App (in Javascript) and launch it, the app fails. How am I supposed to convert a Dart Polymer app to Javascript ? Here's the example code I made that fails : example.html : <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Example</title> <link rel="import" href=

Polymer: Disable HTML Import caching

此生再无相见时 提交于 2019-12-21 17:22:12
问题 How do I disable HTML Import caching for Polymer development? Changes made to my custom HTML web component are not being shown when I refresh the browser. 回答1: HTML Import caching will sometimes mean that changes made to HTML files that get imported do not get reflected upon browser refresh. Take the following import as an example: <link rel="import" href="./my-element.html"> If a change is done to my-element.html after previously loading the page, then the changed file may not be downloaded

Polymer data binding doesn't work when assigning markup to innerHTML that contains attribute data binding

旧时模样 提交于 2019-12-21 12:18:26
问题 What is the simplest way to create data bindings to attributes, in Polymer, when working with innerHTML? This is an example of what i mean - http://jsfiddle.net/ry6og1q9/2/ <paper-input inputValue="{{foo}}" label="static foo"></paper-input> "staticFoo" paper-input is data bound to with {{foo}} - a two way data binding. var c = this.$.dynamicFooPlaceHolder; c.innerHTML = ''; var e = document.createElement('div'); e.innerHTML = '<paper-input id="dynamicFoo" inputValue="{{foo}}" label="dynamic

Specify browser location for wct-local test

狂风中的少年 提交于 2019-12-21 12:03:07
问题 The Polymer Starter Kit contains web-component-tester for unit testing your custom elements. In wct.conf.json you can specify the browsers to run the tests in. { "suites": ["app/test"], "plugins": { "local": { "browsers": ["firefox"] } } Unfortunately, when I launch the tests through gulp, wct is not able to find my local Firefox. I read at GitHub that wct uses launchpad to detect local browsers. Afaik, on a Windows machine, launchpad searches for Firefox in the default directory "C:\Program

Polymer deactivating pages when their not in view

▼魔方 西西 提交于 2019-12-21 09:29:20
问题 I'm using the polymer application drawer template from the polymer cli. I'm having some trouble with: When you load a new page, the html element is imported; then it's code executes When I move to another page the code for the previous page is still running. Is there a way to destroy and create the page/element or suspend and enable? Whats the best practice for dealing with this problem? Have the pages implement a create and destroy method and invoke it when changing page? Ie oldPageElement

Polymer deactivating pages when their not in view

可紊 提交于 2019-12-21 09:28:09
问题 I'm using the polymer application drawer template from the polymer cli. I'm having some trouble with: When you load a new page, the html element is imported; then it's code executes When I move to another page the code for the previous page is still running. Is there a way to destroy and create the page/element or suspend and enable? Whats the best practice for dealing with this problem? Have the pages implement a create and destroy method and invoke it when changing page? Ie oldPageElement

Private non-static variables in polymer?

北战南征 提交于 2019-12-21 08:32:07
问题 How is it possible to have private non-static variables in polymer? In: <polymer-element name="component-one"> <script> Polymer('component-one', { internalState = 1, ready() { this.anotherInternalState = 1; } /* more variables and functions */ }); </script> </polymer-element> both internalState and anotherInernalState are exposed to outside (e.g. accessible through something like: document.querySelector('component-one').internalState (Which might be undesirable when changing internalState

Value is not a sequence Safari exception

穿精又带淫゛_ 提交于 2019-12-21 07:16:08
问题 I'm getting this error on any console.log statement in my codebase. This affects only Safari 11.0 (12604.1.38.1.7) on Mac 10.16.6 How can i resolve this and how this happened? 回答1: You need to disable the "WebDriver" extension. I had this same problem, and my stack trace included a resource called "Script element" which was making this call: b.initMessageEvent("safaridriver.message", !1, !1, a, window.location.origin, "0", window, null); Maybe there's a SafariDriver update out there that also