Sha256: a8912c35b9eb3b8e14f7d963e69324415fdd31bbe50e9cc308e473338c8503be

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

= link_js "http://cdnjs.cloudflare.com/ajax/libs/mithril/0.1.28/mithril.min.js"
= serve_js
:javascript
  var main_url = window.location.toString();
  var production = #{production? ? "true" : "false"};
  $('.offcanvas').click(function(e){ 
    if( e.target !== this ) 
      return;
    $(this).toggleClass('show') 
  })

  start_deferred()

- if @reload_page 
  :javascript
    var wait_timeout = 2000;
    var url = main_url

    function reload(){

      $.ajax({url: add_parameters(main_url, '_layout=false'), cache:false, 
      success: function(data, stat, req){
        if (req.status == 202){
          $('#content').html(data)
          update_rbbt()
          window.setTimeout(reload, wait_timeout);
        }else{
          window.location = main_url;
        }
      },

      error:function(jqXHR, status, thrownError){
        if (undefined === jqXHR.responseText || jqXHR.responseText == ''){
          $('#content').html('No response. Server down?')
        }else{
          $('#content').html(jqXHR.responseText)
        }
        update_rbbt()
      }})
    }

    window.setTimeout(reload, wait_timeout);

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rbbt-rest-1.6.3 share/views/layout/coda.haml