Skip to content

Commit

Permalink
taking newer velocity for julianshapiro/velocity#184
Browse files Browse the repository at this point in the history
  • Loading branch information
ef4 committed Aug 23, 2014
1 parent 9c23856 commit 34e8d75
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
11 changes: 11 additions & 0 deletions app-addon/initializers/liquid-fire.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
/* global $ */
import { initialize } from "vendor/liquid-fire";
import Ember from "ember";

export default {
name: 'liquid-fire',

initialize: function(container) {
if (!$ || !$.Velocity) {
Ember.warn("Velocity.js is missing");
} else {
var version = $.Velocity.version;
var recommended = [0, 11, 8];
if (Ember.compare(recommended, [version.major, version.minor, version.patch]) === 1) {
Ember.warn("You should probably upgrade Velocity.js, recommended minimum is " + recommended.join('.'));
}
}

initialize(container, container.lookupFactory('transitions:main'));
if (Ember.testing) {
Ember.Test.registerWaiter(function(){
Expand Down
3 changes: 1 addition & 2 deletions app-addon/views/liquid-outlet.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ export default Ember.ContainerView.extend({
return animate(this, target, {
duration: this._durationFor(before, after),
queue: false,
easing: this.get('growEasing'),
display: null
easing: this.get('growEasing')
});
}
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dependencies": {
"broccoli-merge-trees": "^0.1.4",
"broccoli-static-compiler": "^0.1.4",
"velocity-animate": "^0.9.0"
"velocity-animate": "^0.11.8"
},
"devDependencies": {
"body-parser": "^1.2.0",
Expand Down
13 changes: 5 additions & 8 deletions vendor-addon/liquid-fire/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@ export function animate(view, props, opts, label) {
opts = Ember.copy(opts);
}

// By default, we ask velocity to reveal the elements at the start
// of animation. Our animated divs are all initially rendered at
// display:none to prevent a flash of before-animated content.
//
// At present, velocity's 'auto' just picks a value for the css
// display property based on the element type. I have a PR that
// would let it defer to the stylesheets instead.
// By default, we ask velocity to clear the element's `display`
// property at the start of animation. Our animated divs are all
// initially rendered at display:none to prevent a flash of
// before-animated content.
if (typeof(opts.display) === 'undefined') {
opts.display = 'auto';
opts.display = '';
}

if (opts.progress) {
Expand Down

0 comments on commit 34e8d75

Please sign in to comment.