mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
toObject fixes
This commit is contained in:
parent
b18b11bc5f
commit
e6c5325ccb
@ -9,6 +9,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## Fixed
|
||||
|
||||
* `toObject` fixes
|
||||
|
||||
## [2.1.7][2018-07-03]
|
||||
|
||||
## Fixed
|
||||
|
||||
* Some drag&drop fixes
|
||||
|
||||
## [2.1.6][2018-06-16]
|
||||
|
4
konva.js
4
konva.js
@ -2,7 +2,7 @@
|
||||
* Konva JavaScript Framework v2.1.7
|
||||
* http://konvajs.github.io/
|
||||
* Licensed under the MIT
|
||||
* Date: Wed Jul 04 2018
|
||||
* Date: Thu Jul 05 2018
|
||||
*
|
||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
|
||||
@ -3604,7 +3604,7 @@
|
||||
|
||||
for (key in attrs) {
|
||||
val = attrs[key];
|
||||
getter = this[key];
|
||||
getter = typeof this[key] === 'function' && this[key];
|
||||
// remove attr value so that we can extract the default value from the getter
|
||||
delete attrs[key];
|
||||
defaultValue = getter ? getter.call(this) : null;
|
||||
|
4
konva.min.js
vendored
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1231,7 +1231,7 @@
|
||||
|
||||
for (key in attrs) {
|
||||
val = attrs[key];
|
||||
getter = this[key];
|
||||
getter = typeof this[key] === 'function' && this[key];
|
||||
// remove attr value so that we can extract the default value from the getter
|
||||
delete attrs[key];
|
||||
defaultValue = getter ? getter.call(this) : null;
|
||||
|
@ -3350,6 +3350,16 @@ suite('Node', function() {
|
||||
delete Number.prototype.customFunc;
|
||||
});
|
||||
|
||||
test('toObject with property in attrs and instanse', function() {
|
||||
var node = new Konva.Circle({
|
||||
id: 'foo',
|
||||
radius: 10,
|
||||
filled: true
|
||||
});
|
||||
node.filled = true;
|
||||
assert.equal(node.toObject().attrs.filled, true);
|
||||
});
|
||||
|
||||
test('test findAncestor', function() {
|
||||
var stage = addStage();
|
||||
stage.setAttrs({
|
||||
|
Loading…
Reference in New Issue
Block a user