Skip to content

Strange thenSet behavior #59

Description

@tutaslabs

Simple animation where node transitions to the left, content changes, and transitions back. This sequence of set/thenSet does not work. Transitioning to the left, back to the right, THEN changing the content DOES work though this is not the desired behavior.

FamousFramework.scene('tutaslabs:test', {
'behaviors': {
'#button': {
content: '[[identity]]',
'origin': [0.5, 0.5],
'align': [0.5, 0.5],
'size': [200, 100],
'position': '[[identity]]',

        'style': {
            'text-align': 'center',
            'line-height': '100px',
            'font-size': '30px',
            'background-color': 'lightblue',
            'cursor':'pointer'
        }
    }
},
'events':{
    '#button': {

        'click': function($state,$event) {
            // this does not work. The first two sets (and the animation) execute then stop. Last transition never
            // happens
            $state.set('position',[-200,0],{duration: 2000}).thenSet('content',"Was clicked").
                thenSet('position',[0,0],{duration: 2000})

            // These sets do work. All three sets (and animations) work as coded.
            // $state.set('position',[-200,0],{duration: 2000}).thenSet('position',[0,0],{duration: 2000}).
            //    thenSet('content',"Was clicked")
        }

    }

},

'states':{
    'content': 'Click me',
    'position': [0,0]
},

'tree': '<node id="button"></node>'

});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions