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

fix: corrected flip() to appropriately use custom transition and callbac... #350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions src/scripts/directives/fa-flipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
<fa-flipper>
<fa-modifier fa-size="[200, 200]">
<fa-surface fa-background-color="'yellow'" fa-click="flipIt()">Click me to see me flip!</fa-surface>
</fa-modifier>
</fa-modifier>
<fa-modifier fa-size="[200, 200]">
<fa-surface fa-background-color="'red'" fa-click="flipIt()">Flip me again!</fa-surface>
</fa-modifier>
</fa-modifier>
</fa-flipper>
</fa-app>
</file>
Expand Down Expand Up @@ -79,11 +79,21 @@ angular.module('famous.angular')
isolate.renderNode = new Flipper(options);
$famousDecorator.addRole('renderable',isolate);
isolate.show();

isolate.children = [];

isolate.flip = function (overrideOptions) {
isolate.renderNode.flip(overrideOptions || scope.$eval(attrs.faOptions));
if (overrideOptions && overrideOptions.callback) {
if (overrideOptions.transition) {
isolate.renderNode.flip(overrideOptions.transition, overrideOptions.callback);
} else {
isolate.renderNode.flip(scope.$eval(attrs.faOptions.transition), overrideOptions.callback);
}
} else if (overrideOptions && overrideOptions.transition) {
isolate.renderNode.flip(overrideOptions.transition);
} else {
isolate.renderNode.flip(scope.$eval(attrs.faOptions.transition));
}
};

$famousDecorator.sequenceWith(
Expand Down Expand Up @@ -122,4 +132,4 @@ angular.module('famous.angular')
}
};
}
]);
]);