Repository URL to install this package:
|
Version:
1.7.0 ▾
|
/**
* @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);