Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
iframeswitcher.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
10 ?>
11 <div id="preview" class="cms-revision-preview">
12  <div class="toolbar">
13  <?php if (!$block->isSingleStoreMode()) :?>
14  <div class="store-switcher">
15  <?= $block->getChildHtml('store_switcher') ?>
16  </div>
17  <?php endif;?>
18  </div>
19  <iframe name="preview_iframe" id="preview_iframe" frameborder="0" title="<?= $block->escapeHtmlAttr(__('Preview')) ?>" width="100%"></iframe>
20  <?= $block->getChildHtml('preview_form') ?>
21 </div>
22 
23 <script>
24 require(['jquery', 'loadingPopup', 'prototype'], function(jQuery){
25 
26 //<![CDATA[
27 var previewForm = $('preview_form');
28 var previewIframe = $('preview_iframe');
29 
30 function preview() {
31  previewForm.writeAttribute('target', previewIframe.readAttribute('id'));
32  blockPreview();
33  previewForm.submit();
34 }
35 
36 function blockPreview() {
37  jQuery('body').loadingPopup({
38  timeout: false
39  });
40 }
41 
42 function unBlockPreview() {
43  jQuery('body').trigger('hideLoadingPopup');
44 }
45 
46 jQuery(document).ready(preview);
47 jQuery(previewIframe).ready(unBlockPreview);
48 
49 jQuery("#preview_iframe").load(function() {
50  jQuery(this).height(jQuery(this).contents().find("html").height() );
51 });
52 
53 //]]>
54 
55 });
56 </script>
taxRateField find('.mselect-list') .on( 'click.mselect-edit'
Definition: edit.phtml:162
$block
Definition: block.php:8
if($block->getLink()) line height
Definition: email.phtml:11
endif
Definition: 404.phtml:116
jQuery('.store-switcher .dropdown-menu li a').each(function()
Definition: switcher.phtml:203