typedjs_filter-1.0.2/js/typedjs_filter.js

js/typedjs_filter.js
/**
 * @file
 * Description.
 */

(function ($, Drupal, once, drupalSettings) {

  Drupal.behaviors.typedjs = {
    attach: function (context, settings) {
      for (var key in drupalSettings.typedjs.strings) {
        if (drupalSettings.typedjs.strings.hasOwnProperty(key)) {
          const elemId = '#' + key;
          $(once(elemId, elemId, context)).each(function() {
            const options = drupalSettings.typedjs.settings;
            options['strings'] = drupalSettings.typedjs.strings[key];
            new Typed(elemId, options);
          })
        }
      }
    }
  }
})(jQuery, Drupal, once, drupalSettings);

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc