@@ -79,7 +79,7 @@ return /******/ (function(modules) { // webpackBootstrap
79
79
80
80
/**
81
81
* Welcome to Typed.js!
82
- * @param {string } elementId HTML element ID
82
+ * @param {string } elementId HTML element ID _OR_ HTML element
83
83
* @param {object } options options object
84
84
* @returns {object } a new Typed object
85
85
*/
@@ -579,13 +579,17 @@ return /******/ (function(modules) { // webpackBootstrap
579
579
* Load up defaults & options on the Typed instance
580
580
* @param {Typed } self instance of Typed
581
581
* @param {object } options options object
582
- * @param {string } elementId HTML element ID
582
+ * @param {string } elementId HTML element ID _OR_ instance of HTML element
583
583
* @private
584
584
*/
585
585
586
586
value : function load ( self , options , elementId ) {
587
587
// chosen element to manipulate text
588
- self . el = document . querySelector ( elementId ) ;
588
+ if ( typeof elementId === 'string' ) {
589
+ self . el = document . querySelector ( elementId ) ;
590
+ } else {
591
+ self . el = elementId ;
592
+ }
589
593
590
594
self . options = { } ;
591
595
Object . assign ( self . options , _defaultsJs2 [ 'default' ] , options ) ;
@@ -639,7 +643,11 @@ return /******/ (function(modules) { // webpackBootstrap
639
643
} ) ;
640
644
641
645
// div containing strings
642
- self . stringsElement = document . querySelector ( self . options . stringsElement ) ;
646
+ if ( typeof self . options . stringsElement === 'string' ) {
647
+ self . stringsElement = document . querySelector ( self . options . stringsElement ) ;
648
+ } else {
649
+ self . stringsElement = self . options . stringsElement ;
650
+ }
643
651
644
652
if ( self . stringsElement ) {
645
653
self . strings = [ ] ;
0 commit comments