-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add property to check if instance has been destroyed.
- Loading branch information
1 parent
7655aab
commit 29d5bc3
Showing
9 changed files
with
63 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* | ||
* typeit - The most versatile animated typing utility on the planet. | ||
* Author: Alex MacArthur <[email protected]> (https://macarthur.me) | ||
* Version: v5.6.1 | ||
* Version: v5.7.0 | ||
* URL: https://typeitjs.com | ||
* License: GPL-2.0 | ||
* | ||
|
@@ -343,13 +343,15 @@ var Instance = function () { | |
|
||
var that = this; | ||
|
||
window.addEventListener("scroll", function checkForStart(event) { | ||
function checkForStart(event) { | ||
if (isVisible(that.element) && !that.hasStarted) { | ||
that.hasStarted = true; | ||
that.next(); | ||
event.currentTarget.removeEventListener(event.type, checkForStart); | ||
} | ||
}); | ||
} | ||
|
||
window.addEventListener("scroll", checkForStart); | ||
} | ||
}, { | ||
key: "cursor", | ||
|
@@ -682,6 +684,7 @@ var TypeIt = function () { | |
this.instances = []; | ||
this.elements = []; | ||
this.args = args; | ||
this.hasBeenDestroyed = false; | ||
|
||
if ((typeof element === "undefined" ? "undefined" : _typeof(element)) === "object") { | ||
//-- There's only one! | ||
|
@@ -809,6 +812,7 @@ var TypeIt = function () { | |
} | ||
}); | ||
|
||
this.hasBeenDestroyed = true; | ||
this.instances = []; | ||
} | ||
}, { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* | ||
* typeit - The most versatile animated typing utility on the planet. | ||
* Author: Alex MacArthur <[email protected]> (https://macarthur.me) | ||
* Version: v5.6.1 | ||
* Version: v5.7.0 | ||
* URL: https://typeitjs.com | ||
* License: GPL-2.0 | ||
* | ||
|
@@ -349,13 +349,15 @@ | |
|
||
var that = this; | ||
|
||
window.addEventListener("scroll", function checkForStart(event) { | ||
function checkForStart(event) { | ||
if (isVisible(that.element) && !that.hasStarted) { | ||
that.hasStarted = true; | ||
that.next(); | ||
event.currentTarget.removeEventListener(event.type, checkForStart); | ||
} | ||
}); | ||
} | ||
|
||
window.addEventListener("scroll", checkForStart); | ||
} | ||
}, { | ||
key: "cursor", | ||
|
@@ -688,6 +690,7 @@ | |
this.instances = []; | ||
this.elements = []; | ||
this.args = args; | ||
this.hasBeenDestroyed = false; | ||
|
||
if ((typeof element === "undefined" ? "undefined" : _typeof(element)) === "object") { | ||
//-- There's only one! | ||
|
@@ -815,6 +818,7 @@ | |
} | ||
}); | ||
|
||
this.hasBeenDestroyed = true; | ||
this.instances = []; | ||
} | ||
}, { | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "typeit", | ||
"version": "5.6.1", | ||
"version": "5.7.0", | ||
"description": "The most versatile animated typing utility on the planet.", | ||
"author": "Alex MacArthur <[email protected]> (https://macarthur.me)", | ||
"license": "GPL-2.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,8 +244,8 @@ aws-sign2@~0.7.0: | |
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" | ||
|
||
aws4@^1.2.1, aws4@^1.6.0: | ||
version "1.6.0" | ||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" | ||
version "1.7.0" | ||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" | ||
|
||
babel-code-frame@^6.26.0: | ||
version "6.26.0" | ||
|
@@ -426,12 +426,13 @@ babel-plugin-external-helpers@^6.22.0: | |
babel-runtime "^6.22.0" | ||
|
||
babel-plugin-istanbul@^4.0.0, babel-plugin-istanbul@^4.1.5: | ||
version "4.1.5" | ||
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.5.tgz#6760cdd977f411d3e175bb064f2bc327d99b2b6e" | ||
version "4.1.6" | ||
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" | ||
dependencies: | ||
babel-plugin-syntax-object-rest-spread "^6.13.0" | ||
find-up "^2.1.0" | ||
istanbul-lib-instrument "^1.7.5" | ||
test-exclude "^4.1.1" | ||
istanbul-lib-instrument "^1.10.1" | ||
test-exclude "^4.2.1" | ||
|
||
babel-plugin-jest-hoist@^21.2.0: | ||
version "21.2.0" | ||
|
@@ -836,16 +837,14 @@ braces@^1.8.2: | |
repeat-element "^1.1.2" | ||
|
||
braces@^2.3.1: | ||
version "2.3.1" | ||
resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.1.tgz#7086c913b4e5a08dbe37ac0ee6a2500c4ba691bb" | ||
version "2.3.2" | ||
resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" | ||
dependencies: | ||
arr-flatten "^1.1.0" | ||
array-unique "^0.3.2" | ||
define-property "^1.0.0" | ||
extend-shallow "^2.0.1" | ||
fill-range "^4.0.0" | ||
isobject "^3.0.1" | ||
kind-of "^6.0.2" | ||
repeat-element "^1.1.2" | ||
snapdragon "^0.8.1" | ||
snapdragon-node "^2.0.1" | ||
|
@@ -910,8 +909,8 @@ camelcase@^4.1.0: | |
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" | ||
|
||
caniuse-lite@^1.0.30000792: | ||
version "1.0.30000821" | ||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000821.tgz#0f3223f1e048ed96451c56ca6cf197058c42cb93" | ||
version "1.0.30000827" | ||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000827.tgz#2dad2354e4810c3c9bb1cfc57f655c270c25fa52" | ||
|
||
caseless@~0.12.0: | ||
version "0.12.0" | ||
|
@@ -1086,8 +1085,8 @@ copy-descriptor@^0.1.0: | |
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" | ||
|
||
core-js@^2.4.0, core-js@^2.5.0: | ||
version "2.5.4" | ||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.4.tgz#f2c8bf181f2a80b92f360121429ce63a2f0aeae0" | ||
version "2.5.5" | ||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.5.tgz#b14dde936c640c0579a6b50cabcc132dd6127e3b" | ||
|
||
[email protected], core-util-is@~1.0.0: | ||
version "1.0.2" | ||
|
@@ -1262,8 +1261,8 @@ [email protected]: | |
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" | ||
|
||
electron-to-chromium@^1.3.30: | ||
version "1.3.41" | ||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.41.tgz#7e33643e00cd85edfd17e04194f6d00e73737235" | ||
version "1.3.42" | ||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.42.tgz#95c33bf01d0cc405556aec899fe61fd4d76ea0f9" | ||
|
||
encodeurl@~1.0.2: | ||
version "1.0.2" | ||
|
@@ -2162,7 +2161,7 @@ istanbul-lib-hook@^1.2.0: | |
dependencies: | ||
append-transform "^0.4.0" | ||
|
||
istanbul-lib-instrument@^1.10.1, istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.5, istanbul-lib-instrument@^1.8.0: | ||
istanbul-lib-instrument@^1.10.1, istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.8.0: | ||
version "1.10.1" | ||
resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz#724b4b6caceba8692d3f1f9d0727e279c401af7b" | ||
dependencies: | ||
|
@@ -2831,8 +2830,8 @@ lcid@^1.0.0: | |
invert-kv "^1.0.0" | ||
|
||
left-pad@^1.2.0: | ||
version "1.2.0" | ||
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee" | ||
version "1.3.0" | ||
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" | ||
|
||
leven@^2.1.0: | ||
version "2.1.0" | ||
|
@@ -3512,15 +3511,15 @@ read-pkg@^2.0.0: | |
path-type "^2.0.0" | ||
|
||
readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.1.4: | ||
version "2.3.5" | ||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.5.tgz#b4f85003a938cbb6ecbce2a124fb1012bd1a838d" | ||
version "2.3.6" | ||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" | ||
dependencies: | ||
core-util-is "~1.0.0" | ||
inherits "~2.0.3" | ||
isarray "~1.0.0" | ||
process-nextick-args "~2.0.0" | ||
safe-buffer "~5.1.1" | ||
string_decoder "~1.0.3" | ||
string_decoder "~1.1.1" | ||
util-deprecate "~1.0.1" | ||
|
||
realpath-native@^1.0.0: | ||
|
@@ -4043,9 +4042,9 @@ string-width@^2.0.0, string-width@^2.1.1: | |
is-fullwidth-code-point "^2.0.0" | ||
strip-ansi "^4.0.0" | ||
|
||
string_decoder@~1.0.3: | ||
version "1.0.3" | ||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" | ||
string_decoder@~1.1.1: | ||
version "1.1.1" | ||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" | ||
dependencies: | ||
safe-buffer "~5.1.0" | ||
|
||
|
@@ -4134,7 +4133,7 @@ tar@^2.2.1: | |
fstream "^1.0.2" | ||
inherits "2" | ||
|
||
test-exclude@^4.1.1: | ||
test-exclude@^4.2.1: | ||
version "4.2.1" | ||
resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.1.tgz#dfa222f03480bca69207ca728b37d74b45f724fa" | ||
dependencies: | ||
|