diff --git a/core/modules/block_place/js/block_place.es6.js b/core/modules/block_place/js/block_place.es6.js index 52adce2c68..3d33648a0e 100644 --- a/core/modules/block_place/js/block_place.es6.js +++ b/core/modules/block_place/js/block_place.es6.js @@ -7,25 +7,19 @@ 'use strict'; - Drupal.blockPlace = { - isBlockPlaceMode: () => { - const queryString = decodeURI(window.location.search); - return (/block-place=1/i.test(queryString) || /block-place-region-sort=/i.test(queryString)); - }, - }; + Drupal.blockPlace.isBlockPlaceMode = true; Drupal.behaviors.blockPlace = { attach(context, settings) { // If drupalSettings.block_place is set open open dialog. if (drupalSettings.hasOwnProperty('block_place') && drupalSettings.block_place.hasOwnProperty('dialog_url')) { $(window).once('block_sort').each(() => { - const blockSort = Drupal.ajax({ + Drupal.ajax({ dialog: {}, dialogType: drupalSettings.block_place.dialog_type, url: drupalSettings.block_place.dialog_url, progress: { type: 'throbber' }, - }); - blockSort.execute(); + }).execute(); }); } },