diff --git a/js/project-issue.js b/js/project-issue.js index 54cca40..e0f34c6 100644 --- a/js/project-issue.js +++ b/js/project-issue.js @@ -3,27 +3,27 @@ /** * A placeholder to save the currently focused input between AJAX requests. */ - Drupal.ajax.focusedInput = false; + Drupal.projectIssueFocusedInput = false; /** * Persistent input focus (retains the proper focus after AJAX replacements). */ - Drupal.behaviors.projectIssueAjaxFocusedInput = { + Drupal.behaviors.projectIssueFocusedInput = { attach: function (context) { var $context = $(context); var inputs = ':input:not([type="hidden"],:submit)'; // Only bind a top level click event once to remove the stored focus if // element is not an input. - $('body').once('ajax-focused-input', function () { + $('body').once('project-issue-focused-input', function () { $(this).bind('mousedown', function (e) { if (!$(e.target).is(inputs)) { - Drupal.ajax.focusedInput = false; + Drupal.projectIssueFocusedInput = false; } }); }); - if (Drupal.ajax.focusedInput) { + if (Drupal.projectIssueFocusedInput) { // Do not use $context here, focused input could not be part of it. - $(':input[name="' + Drupal.ajax.focusedInput + '"]').focus(); + $(':input[name="' + Drupal.projectIssueFocusedInput + '"]').focus(); } // Bind various events on input elements to ensure we save the // proper currently focused element. @@ -35,14 +35,14 @@ if (code === 9) { // Obtain the name of the next input element in the DOM // structure. - Drupal.ajax.focusedInput = $inputs.eq(parseInt($inputs.index($(this)), 10) + 1).attr('name'); + Drupal.projectIssueFocusedInput = $inputs.eq(parseInt($inputs.index($(this)), 10) + 1).attr('name'); } }, 'mousedown': function () { - Drupal.ajax.focusedInput = $(this).attr('name'); + Drupal.projectIssueFocusedInput = $(this).attr('name'); }, 'focus': function () { - Drupal.ajax.focusedInput = $(this).attr('name'); + Drupal.projectIssueFocusedInput = $(this).attr('name'); } }); }