<!DOCTYPE html>
<html>
<head>
  <%= stylesheet_link_tag "client" %>

  <title><%= "Factlink: \"#{@title}\"" || "Factlink modal window" %></title>

  <style type="text/css">
    html, body{
      width: 100%;
      height: 100%;
      background: transparent;
    }
  </style>

  <%= csrf_meta_tag %>
</head>
<body>

  <div class="modal">
    <div class="drag-handler top"   ></div>
    <div class="drag-handler bottom"></div>
    <div class="drag-handler left"  ></div>
    <div class="drag-handler right" ></div>
    <%= yield %>
  </div>

  <%= yield :template %>

  <%= javascript_include_tag "modal" %>

  <%= yield :javascript %>

  <script type="text/javascript">
    $(".modal").draggable({handle: '.drag-handler'});
    $( document ).bind('click', function(e) {
      if( $(e.target).is('body') )
        parent.remote.hide();
    });

    Factlink.allowFeatures(<%= current_ability.feature_toggles.to_s.html_safe %>);
  </script>

</body>
</html>

<!DOCTYPE html>
<html>
<head>
  <%= stylesheet_link_tag "client" %>

  <title><%= "Factlink: \"#{@title}\"" || "Factlink modal window" %></title>

  <style type="text/css">
    html, body{
      width: 100%;
      height: 100%;
      background: transparent;
    }
  </style>

  <%= csrf_meta_tag %>
</head>
<body>

  <div class="modal">
    <div class="drag-handler top"   ></div>
    <div class="drag-handler bottom"></div>
    <div class="drag-handler left"  ></div>
    <div class="drag-handler right" ></div>
    <%= yield %>
  </div>

  <%= yield :template %>


  <%= javascript_include_tag "modal" %>

  <script type="text/javascript">
    Factlink.allowFeatures(<%= current_ability.feature_toggles.to_s.html_safe %>);
  </script>

  <%= yield :javascript %>

  <script type="text/javascript">
    $(".modal").draggable({handle: '.drag-handler'});
    $( document ).bind('click', function(e) {
      if( $(e.target).is('body') )
        parent.remote.hide();
    });
  </script>

</body>
</html>

Load the Factlink.allowFeatures at the correct time
Load the Factlink.allowFeatures at the correct time

Signed-off-by: tomdev <96835dd8bfa718bd6447ccc87af89ae1675daeca@north26.nl>
