Sha256: 723077598bd55c24024ae727aadce313e64f9937b0412fc6ac42fc1c0051a5ec

Contents?: true

Size: 734 Bytes

Versions: 5

Compression:

Stored size: 734 Bytes

Contents

<script>
  window.Cobot = window.Cobot || {};
    window.Cobot.iframeResize = function(height) {
      window.socket.postMessage(height || window.Cobot.iframeHeight());
    }
    window.Cobot.iframeHeight = window.Cobot.iframeHeight || function() {
      $('body').outerHeight();
    }
    window.Cobot.scrollTop = 0;
    easyXDM.query = <%== xdm_params.to_json %>;
    window.socket = new easyXDM.Socket({
      onReady: function() {
        setTimeout(function() {
          window.Cobot.iframeResize();
        }, 100);
      },
      onMessage: function(message) {
        var message = JSON.parse(message);
        if(message.scrollTop) {
          window.Cobot.scrollTop = message.scrollTop;
        }
      }
    });
</script>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cobot_client-0.6.2 app/views/cobot_client/_resize_script.html.erb
cobot_client-0.6.1 app/views/cobot_client/_resize_script.html.erb
cobot_client-0.6.0 app/views/cobot_client/_resize_script.html.erb
cobot_client-0.5.0 app/views/cobot_client/_resize_script.html.erb
cobot_client-0.4.0 app/views/cobot_client/_resize_script.html.erb