Skip to content

Instantly share code, notes, and snippets.

@webOS101
Created September 12, 2014 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webOS101/740c53794f8a12964081 to your computer and use it in GitHub Desktop.
Save webOS101/740c53794f8a12964081 to your computer and use it in GitHub Desktop.
SVG Sample
enyo.ready(function() {
enyo.kind({
name: 'Svg',
svg: '',
rendered: function() {
this.inherited(arguments);
this.svgChanged();
// Can only call when we have a node
},
svgChanged: function() {
var node = this.hasNode();
if(node) {
node.innerHTML = '<embed src="' + this.svg +
'" type="image/svg+xml" />';
}
}
});
enyo.kind({
name: 'View',
components: [
{ kind: 'Svg', svg: 'http://upload.wikimedia.org/wikipedia/commons/8/84/Example.svg' }
]
});
new enyo.Application({name: 'app', view: 'View'});
});
name: SVG Sample
description: A naieve implementation of an SVG control
authors:
- Roy Sutton
normalize_css: no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment