diff --git a/app/assets/javascripts/backbone/views/habits/index_view.js.coffee b/app/assets/javascripts/backbone/views/habits/index_view.js.coffee index c011599cbc..e4852906df 100644 --- a/app/assets/javascripts/backbone/views/habits/index_view.js.coffee +++ b/app/assets/javascripts/backbone/views/habits/index_view.js.coffee @@ -65,4 +65,18 @@ class HabitTracker.Views.Habits.IndexView extends Backbone.View @addAll() @$("#habits-todos").tabs() @updateStats() + $.each ['#habits', '#daily', '#one-offs'], (index, list_id) -> + $(list_id).sortable + axis: "y" + dropOnEmpty: false + cursor: "move" + items: "li" + opacity: 0.4 + scroll: true + update: -> + $.ajax + type: "post" + url: "/habits/sort" + data: $(list_id).sortable("serialize") + dataType: "script" return this \ No newline at end of file diff --git a/app/assets/javascripts/habits.js.coffee b/app/assets/javascripts/habits.js.coffee deleted file mode 100644 index 9defe40dee..0000000000 --- a/app/assets/javascripts/habits.js.coffee +++ /dev/null @@ -1,20 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ - -$(document).ready -> - - $.each ['#habits', '#daily', '#one-offs'], (index, list_id) -> - $(list_id).sortable - axis: "y" - dropOnEmpty: false - cursor: "move" - items: "li" - opacity: 0.4 - scroll: true - update: -> - $.ajax - type: "post" - url: "/habits/sort" - data: $(list_id).sortable("serialize") - dataType: "script" \ No newline at end of file