Sha256: 924267214ef8587d3848fe22302c49f57760f00a49ddff242152062ef0dc3f39

Contents?: true

Size: 737 Bytes

Versions: 3

Compression:

Stored size: 737 Bytes

Contents

(function() {
  var onLoad = function(func) {
    if (window.attachEvent) {
      window.attachEvent('onload', yourFunctionName);
    } else {
      if (window.onload) {
        var curronload = window.onload;
        var newonload = function(evt) {
          curronload(evt);
          func(evt);
        };
        window.onload = newonload;
      } else {
        window.onload = func;
      }
    }
  };

  var currentScript = document.currentScript || (function() {
    var scripts = document.getElementsByTagName("script");
    return scripts[scripts.length - 1];
  })();
  
  var embedDiv = currentScript.previousSibling;

  onLoad(function() {
    Elm.embed(<%= raw module_name %>, embedDiv, <%= raw args.to_json %>);
  });
})();

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elm-rails-0.1.2 app/views/elm/mount_script.js.erb
elm-rails-0.1.1 app/views/elm/mount_script.js.erb
elm-rails-0.0.1 app/views/elm/mount_script.js.erb