diff --git a/app/assets/javascripts/protocols/steps.js b/app/assets/javascripts/protocols/steps.js index 5b6ee01bc..c82f83e67 100644 --- a/app/assets/javascripts/protocols/steps.js +++ b/app/assets/javascripts/protocols/steps.js @@ -291,6 +291,7 @@ function initHandsOnTable(root) { rowHeaders: true, colHeaders: true, fillHandle: false, + formulas: true, cells: function (row, col, prop) { var cellProperties = {}; @@ -338,6 +339,7 @@ function initEditableHandsOnTable(root) { rowHeaders: true, colHeaders: true, contextMenu: true, + formulas: true, preventOverflow: 'horizontal' }); @@ -627,30 +629,6 @@ function expandStep(step) { }); } -// On init -initCallBacks(); -initHandsOnTable($(document)); -expandAllSteps(); -setupAssetsLoading(); - -// Init comments edit/delete -initCommentOptions("ul.content-comments"); -initEditComments("#steps"); -initDeleteComments("#steps"); - -$(function () { - - $("[data-action='collapse-steps']").click(function () { - $('.step .panel-collapse').collapse('hide'); - $(document).find("span.collapse-step-icon").each(function() { - $(this).addClass("glyphicon-collapse-down"); - $(this).removeClass("glyphicon-collapse-up"); - }); - }); - - $("[data-action='expand-steps']").click(expandAllSteps); -}); - function renderTable(table) { $(table).handsontable("render"); // Yet another dirty hack to solve HandsOnTable problems @@ -658,3 +636,29 @@ function renderTable(table) { $(table).find(".ht_master .wtHolder").css("height", "100%"); } } + +$(document).ready(function() { + // On init + initCallBacks(); + initHandsOnTable($(document)); + expandAllSteps(); + setupAssetsLoading(); + + // Init comments edit/delete + initCommentOptions("ul.content-comments"); + initEditComments("#steps"); + initDeleteComments("#steps"); + + $(function () { + + $("[data-action='collapse-steps']").click(function () { + $('.step .panel-collapse').collapse('hide'); + $(document).find("span.collapse-step-icon").each(function() { + $(this).addClass("glyphicon-collapse-down"); + $(this).removeClass("glyphicon-collapse-up"); + }); + }); + + $("[data-action='expand-steps']").click(expandAllSteps); + }); +}) diff --git a/app/views/protocols/_steps.html.erb b/app/views/protocols/_steps.html.erb index f2d94300c..6344b4314 100644 --- a/app/views/protocols/_steps.html.erb +++ b/app/views/protocols/_steps.html.erb @@ -30,4 +30,16 @@ <% end %> -<%= javascript_include_tag "protocols/steps" %> \ No newline at end of file +<%= javascript_include_tag "protocols/steps" %> + + +<%= javascript_include_tag "lodash" %> +<%= javascript_include_tag "numeral" %> +<%= javascript_include_tag "numeric" %> +<%= javascript_include_tag "md5" %> +<%= javascript_include_tag "jstat" %> +<%= javascript_include_tag "formula" %> +<%= javascript_include_tag "parser" %> +<%= javascript_include_tag "ruleJS" %> +<%= javascript_include_tag "handsontable.formula" %> +<%= stylesheet_link_tag "handsontable.formula" %>