Commit 267c84ca by Tomas Alabes

Fixes in master

parent b19a240f
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
| var c = paper.circle(10, 10, 10).attr({hue: .45}); | var c = paper.circle(10, 10, 10).attr({hue: .45});
| // or even like this: | // or even like this:
| c.animate({hue: 1}, 1e3); | c.animate({hue: 1}, 1e3);
| |
| // You could also create custom attribute | // You could also create custom attribute
| // with multiple parameters: | // with multiple parameters:
| paper.customAttributes.hsb = function (h, s, b) { | paper.customAttributes.hsb = function (h, s, b) {
...@@ -392,7 +392,7 @@ ...@@ -392,7 +392,7 @@
* Raphael.is * Raphael.is
[ method ] [ method ]
** **
* Handfull replacement for `typeof` operator. * Handful of replacements for `typeof` operator.
> Parameters > Parameters
- o (…) any object or primitive - o (…) any object or primitive
- type (string) name of the type, i.e. “string”, “function”, “number”, etc. - type (string) name of the type, i.e. “string”, “function”, “number”, etc.
...@@ -468,7 +468,7 @@ ...@@ -468,7 +468,7 @@
** **
* Transform angle to degrees * Transform angle to degrees
> Parameters > Parameters
- deg (number) angle in radians - rad (number) angle in radians
= (number) angle in degrees. = (number) angle in degrees.
\*/ \*/
R.deg = function (rad) { R.deg = function (rad) {
...@@ -691,8 +691,8 @@ ...@@ -691,8 +691,8 @@
if (this.is(h, "object") && "h" in h && "s" in h && "b" in h) { if (this.is(h, "object") && "h" in h && "s" in h && "b" in h) {
v = h.b; v = h.b;
s = h.s; s = h.s;
h = h.h;
o = h.o; o = h.o;
h = h.h;
} }
h *= 360; h *= 360;
var R, G, B, X, C; var R, G, B, X, C;
...@@ -3076,7 +3076,7 @@ ...@@ -3076,7 +3076,7 @@
[ method ] [ method ]
** **
* Adds or retrieves given value asociated with given key. * Adds or retrieves given value asociated with given key.
** **
* See also @Element.removeData * See also @Element.removeData
> Parameters > Parameters
- key (string) key to store data - key (string) key to store data
...@@ -3184,8 +3184,8 @@ ...@@ -3184,8 +3184,8 @@
- mcontext (object) #optional context for moving handler - mcontext (object) #optional context for moving handler
- scontext (object) #optional context for drag start handler - scontext (object) #optional context for drag start handler
- econtext (object) #optional context for drag end handler - econtext (object) #optional context for drag end handler
* Additionaly following `drag` events will be triggered: `drag.start.<id>` on start, * Additionaly following `drag` events will be triggered: `drag.start.<id>` on start,
* `drag.end.<id>` on end and `drag.move.<id>` on every move. When element will be dragged over another element * `drag.end.<id>` on end and `drag.move.<id>` on every move. When element will be dragged over another element
* `drag.over.<id>` will be fired as well. * `drag.over.<id>` will be fired as well.
* *
* Start event and start handler will be called in specified context or in context of the element with following parameters: * Start event and start handler will be called in specified context or in context of the element with following parameters:
...@@ -3487,7 +3487,7 @@ ...@@ -3487,7 +3487,7 @@
* Paper.setViewBox * Paper.setViewBox
[ method ] [ method ]
** **
* Sets the view box of the paper. Practically it gives you ability to zoom and pan whole paper surface by * Sets the view box of the paper. Practically it gives you ability to zoom and pan whole paper surface by
* specifying new boundaries. * specifying new boundaries.
** **
> Parameters > Parameters
...@@ -3960,7 +3960,7 @@ ...@@ -3960,7 +3960,7 @@
elproto.getPath = function () { elproto.getPath = function () {
var path, var path,
getPath = R._getPath[this.type]; getPath = R._getPath[this.type];
if (this.type == "text" || this.type == "set") { if (this.type == "text" || this.type == "set") {
return; return;
} }
...@@ -4246,8 +4246,8 @@ ...@@ -4246,8 +4246,8 @@
} }
} }
return element; return element;
// //
// //
// var a = params ? R.animation(params, ms, easing, callback) : anim, // var a = params ? R.animation(params, ms, easing, callback) : anim,
// status = element.status(anim); // status = element.status(anim);
// return this.animate(a).status(a, status * anim.ms / a.ms); // return this.animate(a).status(a, status * anim.ms / a.ms);
...@@ -4875,7 +4875,7 @@ ...@@ -4875,7 +4875,7 @@
* Set.clear * Set.clear
[ method ] [ method ]
** **
* Removeds all elements from the set * Removes all elements from the set
\*/ \*/
setproto.clear = function () { setproto.clear = function () {
while (this.length) { while (this.length) {
......
...@@ -98,7 +98,7 @@ window.Raphael && window.Raphael.svg && function(R) { ...@@ -98,7 +98,7 @@ window.Raphael && window.Raphael.svg && function(R) {
return null; return null;
} }
id = id.replace(/[\(\)\s,\xb0#]/g, "_"); id = id.replace(/[\(\)\s,\xb0#]/g, "_");
if (element.gradient && id != element.gradient.id) { if (element.gradient && id != element.gradient.id) {
SVG.defs.removeChild(element.gradient); SVG.defs.removeChild(element.gradient);
delete element.gradient; delete element.gradient;
...@@ -204,7 +204,7 @@ window.Raphael && window.Raphael.svg && function(R) { ...@@ -204,7 +204,7 @@ window.Raphael && window.Raphael.svg && function(R) {
} }
if (type != "none") { if (type != "none") {
var pathId = "raphael-marker-" + type, var pathId = "raphael-marker-" + type,
markerId = "raphael-marker-" + se + type + w + h; markerId = "raphael-marker-" + se + type + w + h + o.id;
if (!R._g.doc.getElementById(pathId)) { if (!R._g.doc.getElementById(pathId)) {
p.defs.appendChild($($("path"), { p.defs.appendChild($($("path"), {
"stroke-linecap": "round", "stroke-linecap": "round",
...@@ -639,7 +639,7 @@ window.Raphael && window.Raphael.svg && function(R) { ...@@ -639,7 +639,7 @@ window.Raphael && window.Raphael.svg && function(R) {
* Element.id * Element.id
[ property (number) ] [ property (number) ]
** **
* Unique id of the element. Especially usesful when you want to listen to events of the element, * Unique id of the element. Especially useful when you want to listen to events of the element,
* because all events are fired in format `<module>.<action>.<id>`. Also useful for @Paper.getById method. * because all events are fired in format `<module>.<action>.<id>`. Also useful for @Paper.getById method.
\*/ \*/
this.id = R._oid++; this.id = R._oid++;
...@@ -844,7 +844,7 @@ window.Raphael && window.Raphael.svg && function(R) { ...@@ -844,7 +844,7 @@ window.Raphael && window.Raphael.svg && function(R) {
this.clip && $(this.clip, {transform: this.matrix.invert()}); this.clip && $(this.clip, {transform: this.matrix.invert()});
this.pattern && updatePosition(this); this.pattern && updatePosition(this);
this.node && $(this.node, {transform: this.matrix}); this.node && $(this.node, {transform: this.matrix});
if (_.sx != 1 || _.sy != 1) { if (_.sx != 1 || _.sy != 1) {
var sw = this.attrs[has]("stroke-width") ? this.attrs["stroke-width"] : 1; var sw = this.attrs[has]("stroke-width") ? this.attrs["stroke-width"] : 1;
this.attr({"stroke-width": sw}); this.attr({"stroke-width": sw});
...@@ -896,6 +896,10 @@ window.Raphael && window.Raphael.svg && function(R) { ...@@ -896,6 +896,10 @@ window.Raphael && window.Raphael.svg && function(R) {
} else { } else {
this.node.parentNode.removeChild(this.node); this.node.parentNode.removeChild(this.node);
} }
// Remove custom data for element
this.removeData();
for (var i in this) { for (var i in this) {
this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null; this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null;
} }
...@@ -1091,7 +1095,7 @@ window.Raphael && window.Raphael.svg && function(R) { ...@@ -1091,7 +1095,7 @@ window.Raphael && window.Raphael.svg && function(R) {
} }
var parent = this.node.parentNode; var parent = this.node.parentNode;
if (parent.tagName.toLowerCase() == "a") { if (parent.tagName.toLowerCase() == "a") {
parent.parentNode.insertBefore(this.node.parentNode, this.node.parentNode.parentNode.firstChild); parent.parentNode.insertBefore(this.node.parentNode, this.node.parentNode.parentNode.firstChild);
} else if (parent.firstChild != this.node) { } else if (parent.firstChild != this.node) {
parent.insertBefore(this.node, this.node.parentNode.firstChild); parent.insertBefore(this.node, this.node.parentNode.firstChild);
} }
...@@ -1204,7 +1208,8 @@ window.Raphael && window.Raphael.svg && function(R) { ...@@ -1204,7 +1208,8 @@ window.Raphael && window.Raphael.svg && function(R) {
y: y, y: y,
"text-anchor": "middle", "text-anchor": "middle",
text: text, text: text,
font: R._availableAttrs.font, "font-family": R._availableAttrs["font-family"],
"font-size": R._availableAttrs["font-size"],
stroke: "none", stroke: "none",
fill: "#000" fill: "#000"
}; };
...@@ -1243,7 +1248,8 @@ window.Raphael && window.Raphael.svg && function(R) { ...@@ -1243,7 +1248,8 @@ window.Raphael && window.Raphael.svg && function(R) {
height: height, height: height,
version: 1.1, version: 1.1,
width: width, width: width,
xmlns: "http://www.w3.org/2000/svg" xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink"
}); });
if (container == 1) { if (container == 1) {
cnvs.style.cssText = css + "position:absolute;left:" + x + "px;top:" + y + "px"; cnvs.style.cssText = css + "position:absolute;left:" + x + "px;top:" + y + "px";
......
...@@ -274,8 +274,8 @@ See also <a href="#Element.removeData" class="dr-link">Element.removeData</a> ...@@ -274,8 +274,8 @@ See also <a href="#Element.removeData" class="dr-link">Element.removeData</a>
<dd class="dr-type"><em class="dr-type-object">object</em></dd> <dd class="dr-type"><em class="dr-type-object">object</em></dd>
<dd class="dr-description">context for drag end handler</dd> <dd class="dr-description">context for drag end handler</dd>
</dl> </dl>
<p>Additionaly following <code>drag</code> events will be triggered: <code>drag.start.&lt;id></code> on start, <p>Additionaly following <code>drag</code> events will be triggered: <code>drag.start.&lt;id></code> on start,
<code>drag.end.&lt;id></code> on end and <code>drag.move.&lt;id></code> on every move. When element will be dragged over another element <code>drag.end.&lt;id></code> on end and <code>drag.move.&lt;id></code> on every move. When element will be dragged over another element
<code>drag.over.&lt;id></code> will be fired as well. <code>drag.over.&lt;id></code> will be fired as well.
</p> </p>
<p>Start event and start handler will be called in specified context or in context of the element with following parameters: <p>Start event and start handler will be called in specified context or in context of the element with following parameters:
...@@ -391,7 +391,7 @@ See also <a href="#Element.removeData" class="dr-link">Element.removeData</a> ...@@ -391,7 +391,7 @@ See also <a href="#Element.removeData" class="dr-link">Element.removeData</a>
</dl> </dl>
<p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p> <p class="dr-returns"><strong class="dr-title">Returns:</strong> <em class="dr-type-object">object</em> <span class="dr-description"><a href="#Element" class="dr-link">Element</a></span></p>
</div><div class="Element-id-section"><h3 id="Element.id" class="dr-property"><i class="dr-trixie">&#160;</i>Element.id<a href="#Element.id" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 632 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L632">&#x27ad;</a></h3> </div><div class="Element-id-section"><h3 id="Element.id" class="dr-property"><i class="dr-trixie">&#160;</i>Element.id<a href="#Element.id" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 632 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L632">&#x27ad;</a></h3>
<div class="extra" id="Element.id-extra"></div></div><div class="dr-property"><em class="dr-type dr-type-number">number</em><p>Unique id of the element. Especially usesful when you want to listen to events of the element, <div class="extra" id="Element.id-extra"></div></div><div class="dr-property"><em class="dr-type dr-type-number">number</em><p>Unique id of the element. Especially usesful when you want to listen to events of the element,
because all events are fired in format <code>&lt;module>.&lt;action>.&lt;id></code>. Also useful for <a href="#Paper.getById" class="dr-link">Paper.getById</a> method. because all events are fired in format <code>&lt;module>.&lt;action>.&lt;id></code>. Also useful for <a href="#Paper.getById" class="dr-link">Paper.getById</a> method.
</p> </p>
</div><div class="Element-insertAfter-section"><h3 id="Element.insertAfter" class="dr-method"><i class="dr-trixie">&#160;</i>Element.insertAfter()<a href="#Element.insertAfter" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1096 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L1096">&#x27ad;</a></h3> </div><div class="Element-insertAfter-section"><h3 id="Element.insertAfter" class="dr-method"><i class="dr-trixie">&#160;</i>Element.insertAfter()<a href="#Element.insertAfter" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1096 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L1096">&#x27ad;</a></h3>
...@@ -1404,7 +1404,7 @@ paper.circle(<span class="d">30</span>, <span class="d">10</span>, <span class=" ...@@ -1404,7 +1404,7 @@ paper.circle(<span class="d">30</span>, <span class="d">10</span>, <span class="
st.attr({fill: <i>"red"</i>}); <span class="c">// changes the fill of both circles</span> st.attr({fill: <i>"red"</i>}); <span class="c">// changes the fill of both circles</span>
</code></pre> </code></pre>
</div><div class="Paper-setViewBox-section"><h3 id="Paper.setViewBox" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.setViewBox(x, y, w, h, fit)<a href="#Paper.setViewBox" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3415 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3415">&#x27ad;</a></h3> </div><div class="Paper-setViewBox-section"><h3 id="Paper.setViewBox" class="dr-method"><i class="dr-trixie">&#160;</i>Paper.setViewBox(x, y, w, h, fit)<a href="#Paper.setViewBox" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3415 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L3415">&#x27ad;</a></h3>
<div class="extra" id="Paper.setViewBox-extra"></div></div><div class="dr-method"><p>Sets the view box of the paper. Practically it gives you ability to zoom and pan whole paper surface by <div class="extra" id="Paper.setViewBox-extra"></div></div><div class="dr-method"><p>Sets the view box of the paper. Practically it gives you ability to zoom and pan whole paper surface by
specifying new boundaries. specifying new boundaries.
</p> </p>
<p class="header">Parameters <p class="header">Parameters
...@@ -2323,7 +2323,7 @@ Returns path transformed by a given transformation ...@@ -2323,7 +2323,7 @@ Returns path transformed by a given transformation
</p> </p>
</div><div class="Set-section"><h2 id="Set" class="undefined"><i class="dr-trixie">&#160;</i>Set<a href="#Set" title="Link to this section" class="dr-hash">&#x2693;</a></h2> </div><div class="Set-section"><h2 id="Set" class="undefined"><i class="dr-trixie">&#160;</i>Set<a href="#Set" title="Link to this section" class="dr-hash">&#x2693;</a></h2>
<div class="extra" id="Set-extra"></div></div><div class="Set-clear-section"><h3 id="Set.clear" class="dr-method"><i class="dr-trixie">&#160;</i>Set.clear()<a href="#Set.clear" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4734 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4734">&#x27ad;</a></h3> <div class="extra" id="Set-extra"></div></div><div class="Set-clear-section"><h3 id="Set.clear" class="dr-method"><i class="dr-trixie">&#160;</i>Set.clear()<a href="#Set.clear" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4734 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4734">&#x27ad;</a></h3>
<div class="extra" id="Set.clear-extra"></div></div><div class="dr-method"><p>Removeds all elements from the set <div class="extra" id="Set.clear-extra"></div></div><div class="dr-method"><p>Removes all elements from the set
</p> </p>
</div><div class="Set-exclude-section"><h3 id="Set.exclude" class="dr-method"><i class="dr-trixie">&#160;</i>Set.exclude(element)<a href="#Set.exclude" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4789 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4789">&#x27ad;</a></h3> </div><div class="Set-exclude-section"><h3 id="Set.exclude" class="dr-method"><i class="dr-trixie">&#160;</i>Set.exclude(element)<a href="#Set.exclude" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 4789 in the source" href="https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.core.js#L4789">&#x27ad;</a></h3>
<div class="extra" id="Set.exclude-extra"></div></div><div class="dr-method"><p>Removes given element from the set <div class="extra" id="Set.exclude-extra"></div></div><div class="dr-method"><p>Removes given element from the set
...@@ -2486,4 +2486,4 @@ eve(<i>"login"</i>); <span class="c">// no listeners</span> ...@@ -2486,4 +2486,4 @@ eve(<i>"login"</i>); <span class="c">// no listeners</span>
</div></div></div> </div></div></div>
<script src="raphael.js"></script> <script src="raphael.js"></script>
<script src="reference.js"></script> <script src="reference.js"></script>
</body></html> </body></html>
\ No newline at end of file
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