Webform module and config export

This commit is contained in:
Rob Davies 2017-03-16 15:29:07 +00:00
parent 3e6a5cbed2
commit 0e15467384
1040 changed files with 117682 additions and 0 deletions

View file

@ -0,0 +1,61 @@
/**
* @file
* Javascript behaviors for admin pages.
*/
(function ($, Drupal) {
'use strict';
/**
* Filter webform autocomplete handler.
*
* @type {Drupal~behavior}
*/
Drupal.behaviors.webformFilterAutocomplete = {
attach: function (context) {
$('.webform-filter-form input.form-autocomplete', context).once('webform-autocomplete')
.each(function () {
// If input value is an autocomplete match, reset the input to its
// default value.
if (/\(([^)]+)\)$/.test(this.value)) {
this.value = this.defaultValue;
}
// From: http://stackoverflow.com/questions/5366068/jquery-ui-autocomplete-submit-onclick-result
$(this).bind('autocompleteselect', function (event, ui) {
if (ui.item) {
$(this).val(ui.item.value);
this.form.submit();
}
});
});
}
};
/**
* Allow table rows to be hyperlinked.
*
* @type {Drupal~behavior}
*/
Drupal.behaviors.webformTableRowHref = {
attach: function (context) {
// Only attach the click event handler to the entire table and determine
// which row triggers the event.
$('.webform-results__table', context).once('webform-results-table').click(function (event) {
if (event.target.tagName == 'A' || event.target.tagName == 'BUTTON') {
return true;
}
var $tr = $(event.target).parents('tr[data-webform-href]');
if (!$tr.length) {
return true;
}
window.location = $tr.attr('data-webform-href');
return false;
});
}
};
})(jQuery, Drupal);