|
14 | 14 | <div id="order-message">
|
15 | 15 | <?= $block->getChildHtml('message') ?>
|
16 | 16 | </div>
|
17 |
| - <div id="order-customer-selector" class="fieldset-wrapper order-customer-selector"> |
| 17 | + <div id="order-customer-selector" class="fieldset-wrapper order-customer-selector no-display"> |
18 | 18 | <?= $block->getChildHtml('customer.grid.container') ?>
|
19 | 19 | </div>
|
20 |
| - <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( |
21 |
| - 'display:' . /* @noEscape */ $block->getCustomerSelectorDisplay(), |
22 |
| - 'div#order-customer-selector' |
23 |
| - ) ?> |
24 |
| - <div id="order-store-selector" class="fieldset-wrapper"> |
| 20 | + <div id="order-store-selector" class="fieldset-wrapper no-display"> |
25 | 21 | <?= $block->getChildHtml('store') ?>
|
26 | 22 | </div>
|
27 |
| - <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( |
28 |
| - 'display:' . /* @noEscape */ $block->getStoreSelectorDisplay(), |
29 |
| - 'div#order-store-selector' |
30 |
| - ) ?> |
31 |
| - <div id="order-data"> |
| 23 | + <div id="order-data" class="no-display"> |
32 | 24 | <?= $block->getChildHtml('data') ?>
|
33 | 25 | </div>
|
34 |
| - <?= /* @noEscape */ $secureRenderer->renderStyleAsTag( |
35 |
| - 'display:' . /* @noEscape */ $block->getDataSelectorDisplay(), |
36 |
| - 'div#order-data' |
37 |
| - ) ?> |
38 | 26 | </form>
|
| 27 | +<?php $scriptString = <<<script |
| 28 | +require(['jquery'], function($){ |
| 29 | + 'use strict'; |
| 30 | +
|
| 31 | +script; |
| 32 | +if ($block->getCustomerSelectorDisplay()) { |
| 33 | + $scriptString .= <<<script |
| 34 | + $('div#order-customer-selector').css('display', '{$block->getCustomerSelectorDisplay()}'); |
| 35 | + $('div#order-customer-selector').removeClass('no-display'); |
| 36 | +script; |
| 37 | +} |
| 38 | +if ($block->getStoreSelectorDisplay()) { |
| 39 | + $scriptString .= <<<script |
| 40 | + $('div#order-store-selector').css('display', '{$block->getStoreSelectorDisplay()}'); |
| 41 | + $('div#order-store-selector').removeClass('no-display'); |
| 42 | +script; |
| 43 | +} |
| 44 | +if ($block->getDataSelectorDisplay()) { |
| 45 | + $scriptString .= <<<script |
| 46 | + $('div#order-data').css('display', '{$block->getDataSelectorDisplay()}'); |
| 47 | + $('div#order-data').removeClass('no-display'); |
| 48 | +script; |
| 49 | +} |
| 50 | +$scriptString .= <<<script |
| 51 | +}); |
| 52 | +script; |
| 53 | +?> |
| 54 | +<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?> |
0 commit comments