Created
September 12, 2014 00:01
-
-
Save webOS101/740c53794f8a12964081 to your computer and use it in GitHub Desktop.
SVG Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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