Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
/**
 * @file
 * Title attribute functions.
 */

(function ($, Drupal, document) {

  'use strict';

  let fieldName = '[name="attributes[title]"]';

  /**
   * Automatically populate the title attribute.
   */
  $(document).bind('linkit.autocomplete.select', function (triggerEvent, event, ui) {
    if (ui.item.hasOwnProperty('title')) {
      let title = Drupal.t('A link to the page "@page-title".', {'@page-title': ui.item.title});
      $('form.linkit-editor-dialog-form').find(fieldName).val(title);
    }
  });

})(jQuery, Drupal, document);