Commit 424719f7 by Tomas Alabes

Several Fixes

parent bd74dbaa
......@@ -49,7 +49,7 @@ Remember that if you want to add a functionality it must be present in the vml a
First search for similar issues to make sure you don't repeat an existing one.
Then please create a fiddle ([boilerplate](http://jsfiddle.net/SSJJT/)) recreating the bug so we can find out what the problem is more easily (or be a hero and find it yourself and send a pull request!). You can also use the [raphael playground](http://raphaeljs.com/playground.html) to reproduce your issues.
Then please create a fiddle ([jsfiddle](http://jsfiddle.net/SSJJT/)) recreating the bug so we can find out what the problem is more easily (or be a hero and find it yourself and send a pull request!). You can also use the [raphael playground](http://raphaeljs.com/playground.html) to reproduce your issues.
Remember to add all the info that can be useful such as
......
......@@ -4,6 +4,7 @@
"eqeqeq": true,
"undef": true,
"indent": 4,
"unused": true,
"globals": {
"eve": true
}
......
......@@ -4633,7 +4633,21 @@
p[attr] = params[attr];
}
if (!json) {
return new Animation(params, ms);
// if percent-like syntax is used and end-of-all animation callback used
if(callback){
// find the last one
var lastKey = 0;
for(var i in params){
var percent = toInt(i);
if(params[has](i) && percent > lastKey){
lastKey = percent;
}
}
lastKey += '%';
// if already defined callback in the last keyframe, skip
!params[lastKey].callback && (params[lastKey].callback = callback);
}
return new Animation(params, ms);
} else {
easing && (p.easing = easing);
callback && (p.callback = callback);
......@@ -5384,7 +5398,7 @@
R.st = setproto;
eve.on("raphael.DOMload", function () {
loaded = true;
loaded = true;
});
// Firefox <3.6 fix: http://webreflection.blogspot.com/2009/11/195-chars-to-help-lazy-loading.html
......
......@@ -127,7 +127,7 @@ window.Raphael && window.Raphael.svg && function(R) {
}
}
$(o, {
fill: "url(#" + id + ")",
fill: "url(" + document.location + "#" + id + ")",
opacity: 1,
"fill-opacity": 1
});
......@@ -461,9 +461,6 @@ window.Raphael && window.Raphael.svg && function(R) {
if (o._.sx != 1 || o._.sy != 1) {
value /= mmax(abs(o._.sx), abs(o._.sy)) || 1;
}
if (o.paper._vbSize) {
value *= o.paper._vbSize;
}
node.setAttribute(att, value);
if (attrs["stroke-dasharray"]) {
addDashes(o, attrs["stroke-dasharray"], params);
......
......@@ -910,7 +910,13 @@ window.Raphael && window.Raphael.vml && function(R) {
var createNode;
R._engine.initWin = function (win) {
var doc = win.document;
doc.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
if (doc.styleSheets.length < 31) {
doc.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
} else {
// no more room, add to the existing one
// http://msdn.microsoft.com/en-us/library/ms531194%28VS.85%29.aspx
doc.styleSheets[0].addRule(".rvml", "behavior:url(#default#VML)");
}
try {
!doc.namespaces.rvml && doc.namespaces.add("rvml", "urn:schemas-microsoft-com:vml");
createNode = function (tagName) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5012,7 +5012,21 @@
p[attr] = params[attr];
}
if (!json) {
return new Animation(params, ms);
// if percent-like syntax is used and end-of-all animation callback used
if(callback){
// find the last one
var lastKey = 0;
for(var i in params){
var percent = toInt(i);
if(params[has](i) && percent > lastKey){
lastKey = percent;
}
}
lastKey += '%';
// if already defined callback in the last keyframe, skip
!params[lastKey].callback && (params[lastKey].callback = callback);
}
return new Animation(params, ms);
} else {
easing && (p.easing = easing);
callback && (p.callback = callback);
......@@ -5763,7 +5777,7 @@
R.st = setproto;
eve.on("raphael.DOMload", function () {
loaded = true;
loaded = true;
});
// Firefox <3.6 fix: http://webreflection.blogspot.com/2009/11/195-chars-to-help-lazy-loading.html
......@@ -5913,7 +5927,7 @@
}
}
$(o, {
fill: "url(#" + id + ")",
fill: "url(" + document.location + "#" + id + ")",
opacity: 1,
"fill-opacity": 1
});
......@@ -6247,9 +6261,6 @@
if (o._.sx != 1 || o._.sy != 1) {
value /= mmax(abs(o._.sx), abs(o._.sy)) || 1;
}
if (o.paper._vbSize) {
value *= o.paper._vbSize;
}
node.setAttribute(att, value);
if (attrs["stroke-dasharray"]) {
addDashes(o, attrs["stroke-dasharray"], params);
......@@ -8085,7 +8096,13 @@
var createNode;
R._engine.initWin = function (win) {
var doc = win.document;
doc.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
if (doc.styleSheets.length < 31) {
doc.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
} else {
// no more room, add to the existing one
// http://msdn.microsoft.com/en-us/library/ms531194%28VS.85%29.aspx
doc.styleSheets[0].addRule(".rvml", "behavior:url(#default#VML)");
}
try {
!doc.namespaces.rvml && doc.namespaces.add("rvml", "urn:schemas-microsoft-com:vml");
createNode = function (tagName) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment