From 2696644a19d5770d3a56ec26eba452fe9e58d461 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Mon, 11 Oct 2010 12:21:37 +0000 Subject: [PATCH] Fixed issue 715: Load via ?url= no longer working git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1791 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 4 +++- editor/svgcanvas.js | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 0b252b01..f591c36a 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -211,7 +211,7 @@ var qstr = $.param.querystring(); if(!src) { // urldata.source may have been null if it ended with '=' - if(qstr.indexOf('source=data:' >= 0)) { + if(qstr.indexOf('source=data:') >= 0) { src = qstr.match(/source=(data:[^&]*)/)[1]; } } @@ -4440,6 +4440,8 @@ }; Editor.loadFromURL = function(url, opts) { + if(!opts) opts = {}; + var cache = opts.cache; var cb = opts.callback; diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 941a7444..8f5ea22c 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1856,11 +1856,11 @@ var assignAttributes = this.assignAttributes = function(node, attrs, suspendLeng if(!suspendLength) suspendLength = 0; // Opera has a problem with suspendRedraw() apparently var handle = null; - if (!window.opera) svgroot.suspendRedraw(suspendLength); + if (!isOpera) svgroot.suspendRedraw(suspendLength); for (var i in attrs) { - var ns = (i.substr(0,4) == "xml:" ? xmlns : - i.substr(0,6) == "xlink:" ? xlinkns : null); + var ns = (i.substr(0,4) === "xml:" ? xmlns : + i.substr(0,6) === "xlink:" ? xlinkns : null); if(ns || !unitCheck) { node.setAttributeNS(ns, i, attrs[i]);