Merge github.com:msand/paper.js into msand-master

This commit is contained in:
Jürg Lehni 2013-11-26 23:38:40 +01:00
commit f224bb3e86
2 changed files with 3 additions and 3 deletions

View file

@ -219,7 +219,7 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
function handleAttribute(name) { function handleAttribute(name) {
name += 'Attribute'; name += 'Attribute';
return function(el, attr) { return function(el, attr) {
return el[name](attr) || el[name]('data-paper-' + attr); return el[name] && (el[name](attr) || el[name]('data-paper-' + attr));
}; };
} }

View file

@ -315,9 +315,9 @@ paper.PaperScope.prototype.PaperScript = (function(root) {
if (src) { if (src) {
// If we're loading from a source, request that first and // If we're loading from a source, request that first and
// then run later. // then run later.
paper.Http.request('get', src, function(code) { paper.Http.request('get', src, function(scope, code) {
evaluate(code, scope); evaluate(code, scope);
}); }.bind(this, scope));
} else { } else {
// We can simply get the code form the script tag. // We can simply get the code form the script tag.
evaluate(script.innerHTML, scope); evaluate(script.innerHTML, scope);