Freeze background when calling Popup?

2

What would be the best way to freeze background processing when a popup is called?

<h:link onclick="showModalPopUp(); return false;">link
</h:link>

The best way to pause screen processing while the popup is running, when closed, does processing go back?

var popUpObj;
        function showModalPopUp() {  

            popUpObj = window.open("pagina.xhtml,
                "ModalPopUp",
                "toolbar=no," +
                "scrollbars=no," +
                "location=no," +
                "statusbar=no," +
                "menubar=no," +
                "resizable=0," +
                "width=650," +
                "height=550"
             );
    
asked by anonymous 27.04.2016 / 18:02

2 answers

1

I did it in a very simple way, I just check when my modal was closed.

As the example:

var win = window.open('http://www.google.com', 'google','width=800,height=600,status=0,toolbar=0');   
var timer = setInterval(function() {   
    if(win.closed) {  
        clearInterval(timer);  
        alert('closed');  
    }  
}, 1000); 

While it has not been closed I do not run the processing of my setInterval in the background.

    
28.04.2016 / 17:23
2

If I understand your question you are referring to "Modal", correct? If so, try this code below. It is a bootstrap application. Demo

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Exemplo de Modal</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script><scriptsrc="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h2>Modal Examplo1</h2>

  <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Abrir Modal</button>


  <div class="modal fade" id="myModal" role="dialog">
    <div class="modal-dialog">

      <!-- Modal conteudo-->
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">Modal Header</h4>
        </div>
        <div class="modal-body">
          <p>Conteúdo do seu modal.</p>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
        </div>
      </div>

    </div>
  </div>

</div>

</body>
</html>
    
27.04.2016 / 18:46