Releases: alexmacarthur/typeit
Fix loopDelay Weirdness, Expand Its Flexibility
This release addresses an issue where loopDelay
was overriding nextStringDelay
, causing unexpected timing effects. Now, if left undefined, it will inherit the values from nextStringDelay
, and if it's set, users can pass an array instead of just a single value, exactly the same as how nextStringDelay
behaves.
Introduce autoInit Argument, Add Properties for Checking Instance State
This release introduces the autoInit
argument, so that developers can create an inactive instance, and later initialize it using the .init()
method.
const instance = new TypeIt('#element', {...options}, false);
// Instance will just sit there, until it's manually initialized.
instance.init();
Additionally, properties have been introduced for checking if an instance has started (instance.hasStarted
) and is frozen (instance.isFrozen
).
Add Method to Reset Instance
This release introduces the reset()
method that can be used to reset an instance back to its original state.
Add Property to Check If Instance Has Been Destroyed
Adds property that allows code to check if instance has been previously destroyed.
var myInstance = new TypeIt('#element', {...});
if(myInstance.hasBeenDestroyed) {
//-- Do something.
}
Fix HTML vs Plain Text Handling Bug
Specifically, loop
wasn't working if html
was set to false
, which turned out to be an issue with parsing HTML vs plain text. Additionally, the the incorrect arguments were being passed to the afterComplete
callback method. The documentation was correct, while the code was not.
Add a Bunch of Callback Method Options
This releases introduces several opportunities to register your own callback methods that execute at different times, including before/after each character/step is typed and before/after each string. the callback
option has also been renamed to afterComplete
, with a fallback in place until the next major release. You can register these methods by passing them into a new instance.
new TypeIt('#element', {
//--- Other
beforeString: function(step, queue, instance) {},
afterString: function(step, queue, instance) {},
beforeStep: function(step, queue, instance) {},
afterStep: function(step, queue, instance) {},
afterComplete: function(instance) {}
}
Make TypeIt Work in IE
This release a couple of adjustments to make TypeIt function in Internet Explorer.
Clean Out Previous Remnants Correctly
This release configures TypeIt to clean out any remnants of previous instances of TypeIt inside the same element, which would cause bugs.
Allow Array to be Passed for `nextStringDelay` Option
This feature additions enables users to configure the delay that takes place before a new string is typed and after, instead of being limited to half of the nextStringDelay
value that is passed for each delay.
Fix Deletion Bug When Strings Contain HTML
Fixes a bug that was sometimes causing inaccurate deletion when multiple strings with HTML tags were involved.