Great, thanks! Not 100% a fan of having the attributes end up in the DOM 
(I'd prefer to be able to enable the functionality invisibly), but 
certainly a workable solution.

On Friday, September 12, 2014 11:45:35 AM UTC-7, Eric Bidelman wrote:
>
> Hi Michael,
>
> You can add default attributes by including them on the <polymer-element> 
> definition. Any custom attrs will be included on an instance of the element:
>
> http://www.polymer-project.org/docs/polymer/polymer.html#defaultattrs
>
> On Fri, Sep 12, 2014 at 11:34 AM, Michael Bleigh <[email protected] 
> <javascript:>> wrote:
>
>> Is there any way to reliably attach attribute-based behavior to custom 
>> elements by default? There are two cases I'm thinking of:
>>
>>    1. Wanting to have a host element automatically apply layout 
>>    attributes to itself
>>    2. Wanting to add touch-action on a host element by default
>>
>> In the former case, I know that I can do the CSS manually (but it'd be 
>> nice not to have to) but I'm not sure how to accomplish the latter case 
>> short of actually adding the attribute during the created callback, but 
>> that pollutes the DOM a bit. I'm working around it for now by having an 
>> inner container, but I'd prefer not to have to do that.
>>
>> Any "right way" to do this?
>>
>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Polymer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/polymer-dev/e748660c-32fb-4bd1-99af-c27c886176e3%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/polymer-dev/e748660c-32fb-4bd1-99af-c27c886176e3%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/f2df0691-ef85-4627-adac-81a909a5b217%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to