vendor/assets/javascripts/bhf/application.js in bhf-0.4.2.7 vs vendor/assets/javascripts/bhf/application.js in bhf-0.4.3
- old
+ new
@@ -80,21 +80,23 @@
var platforms = document.body.getElements('.platform');
var mainForm = document.id('main_form');
if (platforms.length) {
var setupSortables = function(scope){
- new Sortables(scope.getElements('.sortable'), {
- handle: '.handle',
- onStart: function(element, clone){
- element.addClass('dragged');
- },
- onComplete: function(element){
- element.removeClass('dragged');
- new Request({
- method: 'put',
- url: this.element.getParent('tbody').get('data-sort-url')
- }).send({data: {order: this.serialize()}});
- }
+ scope.getElements('.sortable').each(function(sortableElems){
+ new Sortables(sortableElems, {
+ handle: '.handle',
+ onStart: function(element, clone){
+ element.addClass('dragged');
+ },
+ onComplete: function(element){
+ element.removeClass('dragged');
+ new Request({
+ method: 'put',
+ url: this.element.getParent('tbody').get('data-sort-url')
+ }).send({data: {order: this.serialize()}});
+ }
+ });
});
};
var updatePlatform = function(href, platform, callback){
ajaxNote.loading();
new Request.HTML({
\ No newline at end of file