Skip to content

Commit

Permalink
create partial for instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronwiggins committed Jul 15, 2015
1 parent 66aabe4 commit 8dff9a6
Show file tree
Hide file tree
Showing 3 changed files with 422 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/views/experiments/_instructions.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="panel panel-default" data-id="<%= instruction.order_number %>">
<%= instruction.order_number %> | <%= instruction.information %><br>
</div>
21 changes: 21 additions & 0 deletions app/views/experiments/instructions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var ready, set_positions;

set_positions = function(){

// loop through and give each task a data-pos
// attribute that holds its position in the DOM
$('.panel.panel-default').each(function(i){
$(this).attr("data-pos",i+1);
});
}

ready = function(){

// call set_positions function
set_positions();

$('.sortable').sortable();

}

$(document).ready(ready);
Loading

0 comments on commit 8dff9a6

Please sign in to comment.