Skip to content

Commit f672ff4

Browse files
committed
_updateParent: fix parent is null issue
1 parent 6a2ac06 commit f672ff4

File tree

6 files changed

+42
-9
lines changed

6 files changed

+42
-9
lines changed

app/build/mojs-curve-editor.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ return /******/ (function(modules) { // webpackBootstrap
160160
}, {
161161
key: '_vars',
162162
value: function _vars() {
163-
this.revision = '1.4.3';
163+
this.revision = '1.4.5';
164164
this.store = (0, _store2.default)();
165165

166166
this._easings = [];
@@ -275,7 +275,11 @@ return /******/ (function(modules) { // webpackBootstrap
275275
value: function _updateParent(easing) {
276276
var parent = easing._parent;
277277

278-
if (parent && parent.setProgress) {
278+
if (!parent) {
279+
return;
280+
};
281+
282+
if (parent.setProgress) {
279283
this._triggerParent(parent);
280284
} else if (parent._o.callbacksContext) {
281285
this._triggerParent(parent._o.callbacksContext.timeline);

app/build/mojs-curve-editor.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/index.html

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,35 @@
6868

6969
<script>
7070

71-
new MojsCurveEditor({ name: 'some name' });
71+
72+
73+
const mojsCurve = new MojsCurveEditor({
74+
name: 'b curve'
75+
});
76+
77+
const rect = new mojs.Shape({
78+
shape: 'rect',
79+
80+
left: {'0%':'100%'},
81+
top: 0,
82+
fill: 'none',
83+
radius: 20,
84+
stroke: { 'rgba(0,255,255, 1)' : 'magenta', easing: mojsCurve.getEasing() },
85+
strokeWidth: { 10: 0 },
86+
angle: { 0: 180 },
87+
88+
duration: 1500,
89+
});
90+
91+
const mainTimeline = new mojs.Timeline;
92+
mainTimeline.add( rect );
93+
const mojsPlayer = new MojsPlayer({ add: mainTimeline });
94+
95+
96+
97+
98+
99+
// new MojsCurveEditor({ name: 'some name' });
72100

73101
// var scaleCurve = new window.MojsCurveEditor({ name: 'curve_scale' });
74102
// var rotateCurve = new window.MojsCurveEditor({ name: 'curve_rotate' });

app/js/app.babel.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class API {
4343
}
4444

4545
_vars () {
46-
this.revision = '1.4.3';
46+
this.revision = '1.4.5';
4747
this.store = initStore();
4848

4949
this._easings = [];
@@ -134,7 +134,9 @@ class API {
134134
_updateParent( easing ) {
135135
const parent = easing._parent;
136136

137-
if ( parent && parent.setProgress ) {
137+
if (!parent) { return; };
138+
139+
if (parent.setProgress ) {
138140
this._triggerParent( parent );
139141
} else if (parent._o.callbacksContext) {
140142
this._triggerParent( parent._o.callbacksContext.timeline );

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mojs-curve-editor",
3-
"version": "1.4.4",
3+
"version": "1.4.5",
44
"description": "mojs GUI for editing easing/property curves",
55
"keywords": [
66
"mojs",

readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
144144

145145
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
146146

147-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
148-
147+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)