JS file misc/ajax_screen_lock.js uses tabs instead of 2 spaces.
Plus it is not possible to override its behavior cause ajaxScreenLock variable exists only locally in this file.

I will provide a patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

duozersk created an issue. See original summary.

duozersk’s picture

Assigned: duozersk » Unassigned
Status: Active » Needs review
FileSize
3.99 KB

Here is a patch fixing code standard and changing ajaxScreenLock to Drupal.ajaxScreenLock

With these changes you can do the following in your custom code (I have changed the css value passed to the blockUI plugin):

  /**
   * Modified ajax_screen_lock function.
   */
  Drupal.ajaxScreenLock = Drupal.ajaxScreenLock || {};
  Drupal.ajaxScreenLock.blockUI = function () {
    Drupal.ajaxScreenLock.unblock = true;
    if (Drupal.settings.ajaxScreenLock.throbber_hide) {
      $('.ajax-progress-throbber').hide();
    }

    $.blockUI({
      message: Drupal.settings.ajaxScreenLock.message,
      css: {
        top: ($(window).height() - 90) / 2 + 'px',
        left: ($(window).width() - 90) / 2 + 'px',
        width: '90px'
      },
      timeout: Drupal.settings.ajaxScreenLock.timeout
    });
  }

Thanks
AndyB

nijk’s picture

I see the need to override the internal workings of this module, particularly in order to control the options passed to the jQuery.blockUI plugin.

Personally I would rather see the module implement proper Drupal JS behaviours and extend the usage of Drupal JS settings to allow admin form control over these options, particularly the css property. There are plenty to support, see: http://jquery.malsup.com/block/#options

  • eugene.ilyin committed c4cde48 on 7.x-1.x
    Issue #2705415 by duozersk: JS code standards and overriding
    
eugene.ilyin’s picture

Problem with indent symbols was not only in JS files. Corrected.

eugene.ilyin’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.