Sha256: 691b341e75e629d84e1161e8bbdea48e9927ff360b336163fcc1a5432c07e066

Contents?: true

Size: 901 Bytes

Versions: 3

Compression:

Stored size: 901 Bytes

Contents

<% id = "#{Time.now.to_i}#{(rand * 1000).ceil}" %>

<div class="js-paloma-hook" data-id="<%= id %>">
  <script type="text/javascript">
    (function(){

      // Do not continue if Paloma not found.
      if (window['Paloma'] === undefined && window['console'] !== undefined){
        console.warn("Paloma not found. Require it in your application.js.");
        return true;
      }

      // Remove any callback details if any
      $('.js-paloma-hook[data-id!=' + <%= id %> + ']').remove();

      var requests = <%= requests.to_json.html_safe %>;

      for (var i = 0, len = requests.length; i < len; i++){
        var request = requests[i];

        Paloma.engine.request(request['resource'],
                              request['action'],
                              request['params']);
      }


      $(document).ready(function(){ Paloma.engine.start(); });

    })();
  </script>
</div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
paloma-3.0.2 app/views/paloma/_hook.html.erb
paloma-3.0.1 app/views/paloma/_hook.html.erb
paloma-3.0.0 app/views/paloma/_hook.html.erb