Skip to content

Commit

Permalink
Make invisible loading overlay immediate to disable clicking other bu…
Browse files Browse the repository at this point in the history
…ttons
  • Loading branch information
justinbeaty committed Aug 19, 2022
1 parent b8d28f6 commit 5255932
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 deletions.
5 changes: 4 additions & 1 deletion app/design/adminhtml/default/default/template/page.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@
<?php echo $this->getChildHtml('js') ?>
<?php echo $this->getChildHtml('profiler') ?>
<div id="loading-mask" style="display:none">
<p class="loader" id="loading_mask_loader"><img src="<?php echo $this->getSkinUrl('images/ajax-loader-tr.gif') ?>" alt="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('adminhtml')->__('Loading...')) ?>"/><br/><?php echo Mage::helper('adminhtml')->__('Please wait...') ?></p>
<div class="backdrop" style="display:none"></div>
<p class="loader" id="loading_mask_loader" style="display:none">
<img src="<?php echo $this->getSkinUrl('images/ajax-loader-tr.gif') ?>" alt="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('adminhtml')->__('Loading...')) ?>"/><br/><?php echo Mage::helper('adminhtml')->__('Please wait...') ?>
</p>
</div>

<?php echo $this->getChildHtml('before_body_end') ?>
Expand Down
10 changes: 6 additions & 4 deletions js/mage/adminhtml/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,15 @@ varienLoaderHandler.handler = {
request.options.loaderArea = $$('#html-body .wrapper')[0]; // Blocks all page

if(request && request.options.loaderArea){
Element.clonePosition($('loading-mask'), $(request.options.loaderArea), {offsetLeft:-2});
Element.show('loading-mask');
toggleSelectsUnderBlock($('loading-mask'), false);
setLoaderPosition();
if(this.timeout) {
clearTimeout(this.timeout);
}
this.timeout = setTimeout(function() {
Element.clonePosition($('loading-mask'), $(request.options.loaderArea), {offsetLeft:-2});
toggleSelectsUnderBlock($('loading-mask'), false);
Element.show('loading-mask');
setLoaderPosition();
Element.childElements('loading-mask').invoke('show');
}, typeof window.LOADING_TIMEOUT === 'undefined' ? 100 : window.LOADING_TIMEOUT);
}
},
Expand All @@ -207,6 +208,7 @@ varienLoaderHandler.handler = {
if(Ajax.activeRequestCount == 0) {
toggleSelectsUnderBlock($('loading-mask'), true);
Element.hide('loading-mask');
Element.childElements('loading-mask').invoke('hide');
if(this.timeout) {
clearTimeout(this.timeout);
this.timeout = null;
Expand Down
10 changes: 8 additions & 2 deletions skin/adminhtml/default/openmage/override.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion skin/adminhtml/default/openmage/override.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions skin/adminhtml/default/openmage/scss/override.scss
Original file line number Diff line number Diff line change
Expand Up @@ -690,11 +690,16 @@ div {
}

#loading-mask {
background: $black_40;
z-index: 1000;
color: $color_dark_grey;
opacity: 1;

.backdrop {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: $black_40;
color: $color_dark_grey;
}
.loader {
width: 160px;
height: 100px;
Expand Down Expand Up @@ -1135,4 +1140,4 @@ img[src$='grid-cal.gif'] {

.emph, .accent {
color: $color_action !important;
}
}

0 comments on commit 5255932

Please sign in to comment.