mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-28 01:04:43 +00:00
Make _removeDefaultValues more flexible.
This commit is contained in:
parent
39184f5ac4
commit
a7f7bdaf80
3 changed files with 16 additions and 12 deletions
14
dist/all.js
vendored
14
dist/all.js
vendored
|
|
@ -1,6 +1,6 @@
|
|||
/*! Fabric.js Copyright 2008-2011, Bitsonnet (Juriy Zaytsev, Maxim Chernyak) */
|
||||
|
||||
var fabric = fabric || { version: "0.2.1" };
|
||||
var fabric = fabric || { version: "0.2.2" };
|
||||
|
||||
/**
|
||||
* Wrapper around `console.log` (when available)
|
||||
|
|
@ -6330,11 +6330,13 @@ fabric.util.animate = animate;
|
|||
*/
|
||||
_removeDefaultValues: function(object) {
|
||||
var defaultOptions = fabric.Object.prototype.options;
|
||||
this.stateProperties.forEach(function(prop) {
|
||||
if (object[prop] === defaultOptions[prop]) {
|
||||
delete object[prop];
|
||||
}
|
||||
});
|
||||
if (defaultOptions) {
|
||||
this.stateProperties.forEach(function(prop) {
|
||||
if (object[prop] === defaultOptions[prop]) {
|
||||
delete object[prop];
|
||||
}
|
||||
});
|
||||
}
|
||||
return object;
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*! Fabric.js Copyright 2008-2011, Bitsonnet (Juriy Zaytsev, Maxim Chernyak) */
|
||||
|
||||
var fabric = fabric || { version: "0.2.1" };
|
||||
var fabric = fabric || { version: "0.2.2" };
|
||||
|
||||
/**
|
||||
* Wrapper around `console.log` (when available)
|
||||
|
|
|
|||
|
|
@ -188,11 +188,13 @@
|
|||
*/
|
||||
_removeDefaultValues: function(object) {
|
||||
var defaultOptions = fabric.Object.prototype.options;
|
||||
this.stateProperties.forEach(function(prop) {
|
||||
if (object[prop] === defaultOptions[prop]) {
|
||||
delete object[prop];
|
||||
}
|
||||
});
|
||||
if (defaultOptions) {
|
||||
this.stateProperties.forEach(function(prop) {
|
||||
if (object[prop] === defaultOptions[prop]) {
|
||||
delete object[prop];
|
||||
}
|
||||
});
|
||||
}
|
||||
return object;
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue