Skip to content

Commit

Permalink
Version number update.
Browse files Browse the repository at this point in the history
  • Loading branch information
darielnoel committed Feb 8, 2015
1 parent a90ff36 commit 4f07446
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 43 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
The MIT License (MIT)

Copyright © 2014 Dariel Noel <[email protected]>
Copyright © 2015 Dariel Noel <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

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.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "AniJS",
"version": "0.9.1",
"version": "0.9.2",
"homepage": "http://anijs.github.io/",
"description": "A Library to Raise your Web Design without Coding.",
"main": "dist/anijs-min.js",
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "anijs",
"version": "0.9.1",
"version": "0.9.2",
"main": "dist/anijs.js",
"scripts": [
"dist/anijs.js"
Expand Down
2 changes: 1 addition & 1 deletion dist/anijs-min.js

Large diffs are not rendered by default.

83 changes: 58 additions & 25 deletions dist/anijs.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,23 +440,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
afterFunctionName: afterFunctionName,
dataAniJSOwner: element,
listener: listener,
event: event
event: event,
before: before
//TODO: eventSystem should be called directly
},

animationContextInstance = new AniJS.AnimationContext(animationContextConfig);

//Si before, le paso el animation context
//TODO: Util is a submodule
if (before) {
if(selfish.Util.isFunction(before)) {
before(event, animationContextInstance);
} else if(selfish.Util.beArray(before)) {
before[0](event, animationContextInstance, selfish._paramsHelper(before));
}
} else {
animationContextInstance.run();
}
animationContextInstance.runAll(animationContextConfig);
};

//TODO: Improve lookup here AniJS.EventSystem
Expand Down Expand Up @@ -837,6 +828,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
animationContextInstance.listener = config.listener;

animationContextInstance.event = config.event;
animationContextInstance.before = config.before;
};

/**
Expand Down Expand Up @@ -870,16 +862,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
});
// Backguard compatibility
if (afterFunctionName !== "holdAnimClass" && afterFunctionName !== "$holdAnimClass") {
lastBehavior = target._ajLastBehavior;
lastBehavior = target._ajLastBehavior;
if(lastBehavior){
// removing the animation by default if there are not hold animClass
nodeHelper.removeClass(target, lastBehavior);
}
target._ajLastBehavior = behavior;
}

// Trigger a reflow in between removing and adding the class name.
// http://css-tricks.com/restart-css-animation/
// http://css-tricks.com/restart-css-animation/
target.offsetWidth = target.offsetWidth;
nodeHelper.addClass(target, behavior);
};
Expand Down Expand Up @@ -907,29 +898,71 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
};

/**
* Execute an animation context instance
* Create an animation context instance for every behavior target list
* and run it
* @method run
* @return
*/
animationContextInstance.run = function() {
animationContextInstance.runAll = function() {
var instance = animationContextInstance,
behaviorTargetList = instance.behaviorTargetList,
behaviorTargetListSize = behaviorTargetList.length,
behavior = instance.behavior,
j = 0,
behaviorTargetListItem;
before = instance.before,
simpleAnimationContextInstance,
event = animationContextInstance.event,
animationContextConfig;

animationContextInstance.hasRunned = 1;
for (j; j < behaviorTargetListSize; j++) {
if(selfish.Util.beArray(behavior)){
animationContextInstance
.doFunctionAction(behaviorTargetList[j], behavior);
} else{
animationContextInstance
.doDefaultAction(behaviorTargetList[j], behavior);

animationContextConfig = {
behaviorTargetList: [behaviorTargetList[j]],
nodeHelper: animationContextInstance.nodeHelper,
animationEndEvent: animationContextInstance.animationEndEvent,
behavior: animationContextInstance.behavior,
after: animationContextInstance.after,
eventSystem: animationContextInstance.eventSystem,
eventTarget: animationContextInstance.eventTarget,
afterFunctionName: animationContextInstance.afterFunctionName,
dataAniJSOwner: animationContextInstance.dataAniJSOwner,
listener: animationContextInstance.listener,
event: event
//TODO: eventSystem should be called directly
};

simpleAnimationContextInstance = new AniJS.AnimationContext(animationContextConfig);
if (before) {
if(selfish.Util.isFunction(before)) {
before(event, simpleAnimationContextInstance);
} else if(selfish.Util.beArray(before)) {
before[0](event, simpleAnimationContextInstance, selfish._paramsHelper(before));
}
} else {
simpleAnimationContextInstance.run();
}
}
};
/**
* Execute an animation context instance
* @method run
* @return
*/
animationContextInstance.run = function() {
var instance = animationContextInstance,
behavior = instance.behavior,
behaviorTargetListItem = instance.behaviorTargetList[0];

animationContextInstance.hasRunned = 1;
if(selfish.Util.beArray(behavior)){
instance
.doFunctionAction(behaviorTargetListItem, behavior);
} else{
instance
.doDefaultAction(behaviorTargetListItem, behavior);
}
};

animationContextInstance.init(config);
});

Expand Down
2 changes: 1 addition & 1 deletion dist/helpers/scrollreveal/anijs-helper-scrollreveal-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 2 additions & 11 deletions dist/helpers/scrollreveal/anijs-helper-scrollreveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

if(!isNaN(parseFloat(params[0]))){
viewportRatio = params[0];
};

//We put in this only the nodes that will be animated
visibleBehaviorTargetList = [];
}

for (var i = 0; i < animationContextBehaviorTargetList.length; i++) {
element = animationContextBehaviorTargetList[i];
Expand All @@ -51,20 +48,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

//The element is not animated again if it's visible
if (!element.isRevealed) {
visibleBehaviorTargetList.push(element);
element.isRevealed = 1;
animationContext.run();
}

} else {
element.isRevealed = 0;
}
}

//Overwrite the behaviorTargetList of the animation
animationContext.behaviorTargetList = visibleBehaviorTargetList;

//Run the animation
animationContext.run();
};

/**
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": "AniJS",
"version": "0.9.1",
"version": "0.9.2",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-copy": "~0.5.0",
Expand Down

0 comments on commit 4f07446

Please sign in to comment.