Sha256: 71037f94f3217881cafc0b32fb04df1f7b144ae74172a9a4d43971b982802ac0

Contents?: true

Size: 825 Bytes

Versions: 8

Compression:

Stored size: 825 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 $('body').outerHeight();
  };
  window.Cobot.scrollTop = 0;
  if(window.top != window) {
    easyXDM.query = <%== xdm_params.to_json %>;
    $(window).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

8 entries across 8 versions & 1 rubygems

Version Path
cobot_client-1.2.1 app/views/cobot_client/_resize_script.html.erb
cobot_client-1.2.0 app/views/cobot_client/_resize_script.html.erb
cobot_client-1.1.1 app/views/cobot_client/_resize_script.html.erb
cobot_client-1.1.0 app/views/cobot_client/_resize_script.html.erb
cobot_client-1.0.0 app/views/cobot_client/_resize_script.html.erb
cobot_client-0.8.0 app/views/cobot_client/_resize_script.html.erb
cobot_client-0.7.0 app/views/cobot_client/_resize_script.html.erb
cobot_client-0.6.7 app/views/cobot_client/_resize_script.html.erb