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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -