1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
var Montage = require("montage").Montage, Component = require("montage/ui/component").Component; var Image = exports.Image = Montage.create(Component, { _src: {value: null}, src: { set: function(value) { this._src = value; this.needsDraw = true; } }, draw: { value: function() { this._element.style.backgroundImage = "url(" + this._src + ")"; } } });