mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-19 12:18:51 +00:00
using .sortable for lists, seems to work but still need to double check
This commit is contained in:
parent
601474c958
commit
5f93ec95fa
2 changed files with 19 additions and 20 deletions
|
|
@ -5,7 +5,7 @@
|
|||
<div class='content'>
|
||||
<h2 class='title'>Habits</h2>
|
||||
<div class='inner'>
|
||||
<ul id="habits-habits" />
|
||||
<ul id="habits-habits" class="sortable" />
|
||||
<input class="new-habit" data-type="1" placeholder="New Habit" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
<div class='content'>
|
||||
<h2 class='title'>Daily</h2>
|
||||
<div class='inner'>
|
||||
<ul id="habits-daily" />
|
||||
<ul id="habits-daily" class="sortable" />
|
||||
<input class="new-habit" data-type="2" placeholder="New Daily" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -36,10 +36,10 @@
|
|||
<li><a href="#tabs-2">Done</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
<ul id="habits-todos-remaining" />
|
||||
<ul id="habits-todos-remaining" class="sortable" />
|
||||
</div>
|
||||
<div id="tabs-2">
|
||||
<ul id="habits-todos-done" />
|
||||
<ul id="habits-todos-done" class="sortable" />
|
||||
<a href="#" class="clear-completed">Clear Completed</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
<div id="money"></div>
|
||||
</h2>
|
||||
<div class='inner'>
|
||||
<ul id="rewards" />
|
||||
<ul id="rewards" class="sortable" />
|
||||
<input class="new-habit" data-type="4" placeholder="New Reward" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -65,18 +65,17 @@ 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
|
||||
@$(".sortable").sortable
|
||||
axis: "y"
|
||||
dropOnEmpty: false
|
||||
cursor: "move"
|
||||
items: "li"
|
||||
opacity: 0.4
|
||||
scroll: true
|
||||
update: ->
|
||||
$.ajax
|
||||
type: "post"
|
||||
url: "/habits/sort"
|
||||
data: $(this).sortable("serialize")
|
||||
dataType: "script"
|
||||
return this
|
||||
|
|
|
|||
Loading…
Reference in a new issue