1

This might be a very simple question, but I can't figure out the answer.

I love the overlay module in drupal 7, but I am annoyed by the lack of visual feedback when a form is submitted in an overlay. eg. admin/structure/block, hitting submit doesn't give any indication that something is happening in the background.

I would love to know what I have to do to attach some behavior to the submit button of a form in an overlay that provides visual feedback that the form has been submitted (like greying out the overlay or something).

3
  • This is one of the reasons I turn off Overlay as soon as I can. :-)
    – paul-m
    Commented Mar 18, 2012 at 19:41
  • Is this a question about how to add JavsScript or how to write JavaScript that does the above?
    – googletorp
    Commented Mar 18, 2012 at 20:32
  • The question is what is the JavaScript that does the above. I know how to write and add it (different ways) but haven't been able to figure out WHAT to write
    – Jamgold
    Commented Mar 18, 2012 at 20:46

2 Answers 2

3

I just added a block with following code to the content region of my administration theme

<style type="text/css">
#overlay-inactive {
 z-index:100;
 opacity:0.5;
 background-color:grey;
 position: absolute;
 top: 0px;
 left: 0px;
 width:100%;
 height: 100%;
}
</style>
<script>
jQuery(document).ready(function(){
 jQuery('input[type=submit]').click(function(){
   jQuery('#overlay').append('<div id="overlay-inactive">&nbsp;</div>');
  return true;
 });
});
</script>
1
  • Yeah, that would do it. Commented Mar 20, 2012 at 0:18
0

You could use jquery-loadmask. It looks like it grays out the div and puts a throbber over it.

1
  • Thanks for answering, I don't think I even need another library. Guess I figured it out
    – Jamgold
    Commented Mar 19, 2012 at 4:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.