aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/ujs/views/layouts/application.html.erb
blob: 74fa3bd06d082016e6cc0336a77ed9fa420814a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html id="html">
  <head>
    <title><%= @title %></title>
    <link href="/vendor/qunit.css" media="screen" rel="stylesheet" type="text/css" media="screen, projection" />
    <style>
      #jquery-cdn, #jquery-version {
        padding: 0 2em .8em 0;
        text-align: right;
        font-family: sans-serif;
        line-height: 1;
        color: #8699A4;
        background-color: #0d3349;
      }
      #jquery-cdn a, #jquery-version a {
        color: white;
        text-decoration: underline;
      }
    </style>

    <%= script_tag jquery_src %>
    <script>
      // This is for test in override.js.
      // Must go after jQuery is loaded, but before jquery-ujs.
      $(document).bind('rails:attachBindings', function() {
        $.rails.linkClickSelector += ', a[data-custom-remote-link]';
        // Hijacks link click before ujs binds any handlers
        // This is only used for ctrl-clicking test on remote links
        $.rails.delegate(document, '#qunit-fixture a', 'click', function(e) {
          e.preventDefault();
        });
      });
    </script>
    <%= script_tag "/rails-ujs.js" %>
  </head>

  <body id="body">
    <%= yield %>
  </body>
</html>