fixed bug related to multiple drag and drop initializations

This commit is contained in:
Eric Rowell
2012-04-01 09:32:20 -07:00
parent 6889cd742c
commit 3a8afc747c
4 changed files with 88 additions and 48 deletions

12
dist/kinetic-core.js vendored
View File

@@ -628,7 +628,7 @@ Kinetic.Node.prototype = {
*/
draggable: function(isDraggable) {
if(this.draggable !== isDraggable) {
if(isDraggable) {
if(isDraggable && this.isDragging()) {
this._initDrag();
}
else {
@@ -1187,7 +1187,15 @@ Kinetic.Stage.prototype = {
addLayer(n);
}
else {
callback(bufferLayer.getCanvas().toDataURL(mimeType, quality));
try {
// If this call fails (due to browser bug, like in Firefox 3.6),
// then revert to previous no-parameter image/png behavior
callback(bufferLayer.getCanvas().toDataURL(mimeType, quality));
}
catch(exception)
{
callback(bufferLayer.getCanvas().toDataURL());
}
}
};
imageObj.src = dataURL;

File diff suppressed because one or more lines are too long