title: How to prevent Richfaces popupPanel from being moved in JavaScript?
body: <p>Im using rich:PopupPanel components to display some content and I want them to be able to being maximized and restored by user. I've already implemented resizing and positioning of the component, but the problem is how to prevent popupPanel from being moved while it's maximized and allow it when its restored.</p>
  
  <p>This is my code for button that is responsible for maximizing and restoring the popupPanel</p>
  
  <pre><code>&lt;!-- language: lang-js --&gt;
  &lt;a4j:commandLink id="maximizeRestoreButton" execute="@none"
      render="@none" value="Maximize"
      oncomplete="
          var comp = #{rich:component(cc.attrs.popupId)};
  
          if (comp.isMaximized) {
              var rv = comp.restoreValues;                    
  
              comp.moveTo(rv.top, rv.left);
              comp.resize(rv.width - comp.width(), rv.height - comp.height());
              comp.isMaximized = false;
          } else {
              var rv = new Object();
              rv.top = comp.getTop();
              rv.left = comp.getLeft();
              rv.width = comp.width();
              rv.height = comp.height();
  
              comp.moveTo(0,0);
              comp.resize(window.innerWidth - comp.width(), window.innerHeight - comp.height()); 
  
              comp.isMaximized = true;
              comp.restoreValues = rv;
          }
  
          return false;" /&gt;
  </code></pre>