Sha256: 008b13f959e9c0a27b922df59fdcf54941137636053c78d4cb2ed7976de338ea

Contents?: true

Size: 845 Bytes

Versions: 3

Compression:

Stored size: 845 Bytes

Contents

<script>
  window.Cobot = window.Cobot || {};
  window.Cobot.iframeResize = function(height) {
    if(window.top != window && window.socket) {
      window.socket.postMessage(height || window.Cobot.iframeHeight());
    }
  };
  window.Cobot.iframeHeight = window.Cobot.iframeHeight || function() {
    return document.body.offsetHeight;
  };
  window.Cobot.scrollTop = 0;
  if(window.top != window) {
    easyXDM.query = <%== xdm_params.to_json %>;
    window.addEventListener('load', function() {
      window.socket = new easyXDM.Socket({
        onReady: function() {
          window.Cobot.iframeResize();
        },
        onMessage: function(message) {
          message = JSON.parse(message);
          if(message.scrollTop) {
            window.Cobot.scrollTop = message.scrollTop;
          }
        }
      });
    });
  }
</script>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cobot_client-1.2.4 app/views/cobot_client/_resize_script.html.erb
cobot_client-1.2.3 app/views/cobot_client/_resize_script.html.erb
cobot_client-1.2.2 app/views/cobot_client/_resize_script.html.erb