mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-12 15:53:10 +00:00
Add support for loading local files in fabric.loadSVGFromURL
This commit is contained in:
parent
83b7ef57e7
commit
40490dc7f3
1 changed files with 10 additions and 3 deletions
13
src/node.js
13
src/node.js
|
|
@ -79,9 +79,16 @@
|
|||
|
||||
fabric.loadSVGFromURL = function(url, callback) {
|
||||
url = url.replace(/^\n\s*/, '').replace(/\?.*$/, '').trim();
|
||||
request(url, '', function(body) {
|
||||
fabric.loadSVGFromString(body, callback);
|
||||
});
|
||||
if (url.indexOf('http') !== 0) {
|
||||
request_fs(url, function(body) {
|
||||
fabric.loadSVGFromString(body, callback);
|
||||
});
|
||||
}
|
||||
else {
|
||||
request(url, '', function(body) {
|
||||
fabric.loadSVGFromString(body, callback);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
fabric.loadSVGFromString = function(string, callback) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue