Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange thenSet behavior #59

Open
tutaslabs opened this issue Jul 8, 2015 · 1 comment
Open

Strange thenSet behavior #59

tutaslabs opened this issue Jul 8, 2015 · 1 comment

Comments

@tutaslabs
Copy link

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>'

});

@Imti
Copy link
Contributor

Imti commented Jul 8, 2015

@tutaslabs

Thanks for the issue, this is a known bug with using .thenSet() without a duration.

This is on my radar for things to fix in the state manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants