Skip to content

Commit

Permalink
_updateParent: fix parent is null issue
Browse files Browse the repository at this point in the history
  • Loading branch information
legomushroom committed Oct 10, 2016
1 parent 6a2ac06 commit f672ff4
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 9 deletions.
8 changes: 6 additions & 2 deletions app/build/mojs-curve-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: '_vars',
value: function _vars() {
this.revision = '1.4.3';
this.revision = '1.4.5';
this.store = (0, _store2.default)();

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

if (parent && parent.setProgress) {
if (!parent) {
return;
};

if (parent.setProgress) {
this._triggerParent(parent);
} else if (parent._o.callbacksContext) {
this._triggerParent(parent._o.callbacksContext.timeline);
Expand Down
2 changes: 1 addition & 1 deletion app/build/mojs-curve-editor.min.js

Large diffs are not rendered by default.

30 changes: 29 additions & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,35 @@

<script>

new MojsCurveEditor({ name: 'some name' });


const mojsCurve = new MojsCurveEditor({
name: 'b curve'
});

const rect = new mojs.Shape({
shape: 'rect',

left: {'0%':'100%'},
top: 0,
fill: 'none',
radius: 20,
stroke: { 'rgba(0,255,255, 1)' : 'magenta', easing: mojsCurve.getEasing() },
strokeWidth: { 10: 0 },
angle: { 0: 180 },

duration: 1500,
});

const mainTimeline = new mojs.Timeline;
mainTimeline.add( rect );
const mojsPlayer = new MojsPlayer({ add: mainTimeline });





// new MojsCurveEditor({ name: 'some name' });

// var scaleCurve = new window.MojsCurveEditor({ name: 'curve_scale' });
// var rotateCurve = new window.MojsCurveEditor({ name: 'curve_rotate' });
Expand Down
6 changes: 4 additions & 2 deletions app/js/app.babel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class API {
}

_vars () {
this.revision = '1.4.3';
this.revision = '1.4.5';
this.store = initStore();

this._easings = [];
Expand Down Expand Up @@ -134,7 +134,9 @@ class API {
_updateParent( easing ) {
const parent = easing._parent;

if ( parent && parent.setProgress ) {
if (!parent) { return; };

if (parent.setProgress ) {
this._triggerParent( parent );
} else if (parent._o.callbacksContext) {
this._triggerParent( parent._o.callbacksContext.timeline );
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mojs-curve-editor",
"version": "1.4.4",
"version": "1.4.5",
"description": "mojs GUI for editing easing/property curves",
"keywords": [
"mojs",
Expand Down
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of

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

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.

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 comments on commit f672ff4

Please sign in to comment.