Skip to content

Commit

Permalink
v.0.2.2 Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwellito committed Jul 9, 2015
1 parent cfeab69 commit b47647e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions dist/vivus.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* vivus - JavaScript library to make drawing animation on SVG
* @version v0.2.1
* @version v0.2.2
* @link https://github.com/maxwellito/vivus
* @license MIT
*/
Expand Down Expand Up @@ -361,6 +361,7 @@ Vivus.prototype.setElement = function (element, options) {
throw new Error('Vivus [constructor]: "element" parameter is not related to an existing ID');
}
}
this.parentEl = element;

// Create the object element if the property `file` exists in the options object
if (options && options.file) {
Expand Down Expand Up @@ -440,7 +441,7 @@ Vivus.prototype.setOptions = function (options) {
this.start = options.start || allowedStarts[0];
}

this.isIE = (window.navigator.userAgent.indexOf('MSIE') !== -1 || window.navigator.userAgent.indexOf('Trident/') !== -1 || window.navigator.userAgent.indexOf('Edge/') !== -1 );
this.isIE = (window.navigator.userAgent.indexOf('MSIE') !== -1);
this.duration = parsePositiveInt(options.duration, 120);
this.delay = parsePositiveInt(options.delay, null);
this.dashGap = parsePositiveInt(options.dashGap, 2);
Expand Down Expand Up @@ -705,7 +706,7 @@ Vivus.prototype.starter = function () {
case 'inViewport':
var self = this,
listener = function () {
if (self.isInViewport(self.el, 1)) {
if (self.isInViewport(self.parentEl, 1)) {
self.play();
window.removeEventListener('scroll', listener);
}
Expand Down
Loading

0 comments on commit b47647e

Please sign in to comment.