Skip to content

Commit

Permalink
Initial refactor: replace Scriptaculous dragdrop with SortableJS v1.15.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfb committed Dec 10, 2024
1 parent e03dc97 commit f7104c5
Show file tree
Hide file tree
Showing 32 changed files with 3,431 additions and 1,019 deletions.
3,388 changes: 3,388 additions & 0 deletions app/assets/javascripts/Sortable.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/assets/javascripts/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function multiUpdate(id, newItem)
$$('#multiPlus_' + id + ' > input').each(function(item){item.clear();});
$$('#multiPlus_' + id + ' > select').each(function(item){item.clear();});

Sortable.create('multiItems_' + id, {overlap: 'horizontal', constraint: false, handle: 'move'});
Sortable.create(document.getElementById('multiItems_' + id), {direction: 'horizontal', handle: '.move'});
}

function multiRemove(item)
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//= require rails
//= require rails-ujs
//= require effects
//= require dragdrop
//= require Sortable
//= require_self

// Place your application-specific JavaScript functions and classes here
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/dclp.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ function multiAddWork(e){
' <span onclick="multiAddWorkAuthorAuthority(this)" title="✓">add</span>' +
' </p>' +
' <script>' +
' Sortable.create(\'multiItems_workAuthorAuthority' + workIndex +'\', {overlap: \'horizontal\', constraint: false, handle: \'move\'});' +
' Sortable.create(document.getElementById(\'multiItems_workAuthorAuthority' + workIndex +'\'), {direction: \'horizontal\', handle: \'.move\'});' +
' </script>' +
' </div>' +
' </div>' +
Expand All @@ -274,7 +274,7 @@ function multiAddWork(e){
' <span onclick="multiAddWorkTitleAuthority(this)" title="✓">add</span>' +
' </p>' +
' <script>' +
' Sortable.create(\'multiItems_workTitleAuthority' + workIndex +'\', {overlap: \'horizontal\', constraint: false, handle: \'move\'});' +
' Sortable.create(document.getElementById(\'multiItems_workTitleAuthority' + workIndex +'\'), {direction: \'horizontal\', handle: \'.move\'});' +
' </script>' +
' </div>' +
' <input class="observechange workCertainty" id="hgv_meta_identifier_work_' + workIndex +'_children_title_children_certainty_value" name="hgv_meta_identifier[work][' + workIndex +'][children][title][children][certainty][value]" type="hidden">' +
Expand All @@ -297,7 +297,7 @@ function multiAddWork(e){
' <span onclick="multiAddWorkExtraAnd(this)" title="✓">add and</span>' +
' </p>' +
' <script>' +
' Sortable.create(\'multiItems_workExtra' + workIndex +'\', {overlap: \'horizontal\', constraint: false, handle: \'move\'});' +
' Sortable.create(document.getElementById(\'multiItems_workExtra' + workIndex +'\'), {direction: \'horizontal\', handle: \'.move\'});' +
' </script>' +
' </div>' +
' <div class="clear"></div>' +
Expand Down
Loading

0 comments on commit f7104c5

Please sign in to comment.