ember.js - Styling the Ember rootElement -


i've been banging head against on day , no amount of experimenting, google'ing, or stack overflow searching has helped.

i'm developing ember/vert.x app has 1 ember route accepts "real-time" push-data via socksjs. working beautifully, including successful implementation of dynamic (ember) templates.

what need ability set styles on rootelement (rootelement body). i've tried umpteen different approaches, including resorting jquery calls. nothing place style on body tag. can style attribute set on 1st div inside body tag doing:

app.applicationview = ember.view.extend({   attributebindings:  ['style'],   style: "background-color: blue; background-image: url('" + app.currentprogram.backgroundimage + "')" }); 

this renders:

<div id="ember325" class="ember-view" style="background-image: url('img/bg/1.png')">...</div> 

however, want style body tag dynamically.

any appreciated blocking item prototype client demo next week.

you can use didinsertelement method, know when dom inserted, , update body element using this.$().parent().

app.applicationview = ember.view.extend({     didinsertelement: function() {         this._super();                 this.$().parent().css({             "background-color": "blue",             "background-image": "url('" + app.currentprogram.backgroundimage + "')"         });     } }) 

live sample http://jsfiddle.net/x5tmh/


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -