@@ -114,7 +114,6 @@ Drupal.jsAC.prototype.onkeyup = function (input, e) {
|
||||
*/
|
||||
Drupal.jsAC.prototype.select = function (node) {
|
||||
this.input.value = $(node).data('autocompleteValue');
|
||||
$(this.input).trigger('autocompleteSelect', [node]);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -168,7 +167,7 @@ Drupal.jsAC.prototype.unhighlight = function (node) {
|
||||
Drupal.jsAC.prototype.hidePopup = function (keycode) {
|
||||
// Select item if the right key or mousebutton was pressed.
|
||||
if (this.selected && ((keycode && keycode != 46 && keycode != 8 && keycode != 27) || !keycode)) {
|
||||
this.select(this.selected);
|
||||
this.input.value = $(this.selected).data('autocompleteValue');
|
||||
}
|
||||
// Hide popup.
|
||||
var popup = this.popup;
|
||||
@@ -221,7 +220,7 @@ Drupal.jsAC.prototype.found = function (matches) {
|
||||
for (key in matches) {
|
||||
$('<li></li>')
|
||||
.html($('<div></div>').html(matches[key]))
|
||||
.mousedown(function () { ac.hidePopup(this); })
|
||||
.mousedown(function () { ac.select(this); })
|
||||
.mouseover(function () { ac.highlight(this); })
|
||||
.mouseout(function () { ac.unhighlight(this); })
|
||||
.data('autocompleteValue', key)
|
||||
|
@@ -58,7 +58,7 @@ Drupal.behaviors.collapse = {
|
||||
$('fieldset.collapsible', context).once('collapse', function () {
|
||||
var $fieldset = $(this);
|
||||
// Expand fieldset if there are errors inside, or if it contains an
|
||||
// element that is targeted by the uri fragment identifier.
|
||||
// element that is targeted by the URI fragment identifier.
|
||||
var anchor = location.hash && location.hash != '#' ? ', ' + location.hash : '';
|
||||
if ($('.error' + anchor, $fieldset).length) {
|
||||
$fieldset.removeClass('collapsed');
|
||||
|
@@ -482,8 +482,8 @@ $(document).bind('state:disabled', function(e) {
|
||||
if (e.trigger) {
|
||||
$(e.target)
|
||||
.attr('disabled', e.value)
|
||||
.filter('.form-element')
|
||||
.closest('.form-item, .form-submit, .form-wrapper').toggleClass('form-disabled', e.value);
|
||||
.closest('.form-item, .form-submit, .form-wrapper').toggleClass('form-disabled', e.value)
|
||||
.find('select, input, textarea').attr('disabled', e.value);
|
||||
|
||||
// Note: WebKit nightlies don't reflect that change correctly.
|
||||
// See https://bugs.webkit.org/show_bug.cgi?id=23789
|
||||
|
Reference in New Issue
Block a user