mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +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'>
|
<div class='content'>
|
||||||
<h2 class='title'>Habits</h2>
|
<h2 class='title'>Habits</h2>
|
||||||
<div class='inner'>
|
<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" />
|
<input class="new-habit" data-type="1" placeholder="New Habit" type="text" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<div class='content'>
|
<div class='content'>
|
||||||
<h2 class='title'>Daily</h2>
|
<h2 class='title'>Daily</h2>
|
||||||
<div class='inner'>
|
<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" />
|
<input class="new-habit" data-type="2" placeholder="New Daily" type="text" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -36,10 +36,10 @@
|
||||||
<li><a href="#tabs-2">Done</a></li>
|
<li><a href="#tabs-2">Done</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="tabs-1">
|
<div id="tabs-1">
|
||||||
<ul id="habits-todos-remaining" />
|
<ul id="habits-todos-remaining" class="sortable" />
|
||||||
</div>
|
</div>
|
||||||
<div id="tabs-2">
|
<div id="tabs-2">
|
||||||
<ul id="habits-todos-done" />
|
<ul id="habits-todos-done" class="sortable" />
|
||||||
<a href="#" class="clear-completed">Clear Completed</a>
|
<a href="#" class="clear-completed">Clear Completed</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
<div id="money"></div>
|
<div id="money"></div>
|
||||||
</h2>
|
</h2>
|
||||||
<div class='inner'>
|
<div class='inner'>
|
||||||
<ul id="rewards" />
|
<ul id="rewards" class="sortable" />
|
||||||
<input class="new-habit" data-type="4" placeholder="New Reward" type="text" />
|
<input class="new-habit" data-type="4" placeholder="New Reward" type="text" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,7 @@ class HabitTracker.Views.Habits.IndexView extends Backbone.View
|
||||||
@addAll()
|
@addAll()
|
||||||
@$("#habits-todos").tabs()
|
@$("#habits-todos").tabs()
|
||||||
@updateStats()
|
@updateStats()
|
||||||
$.each ['#habits', '#daily', '#one-offs'], (index, list_id) ->
|
@$(".sortable").sortable
|
||||||
$(list_id).sortable
|
|
||||||
axis: "y"
|
axis: "y"
|
||||||
dropOnEmpty: false
|
dropOnEmpty: false
|
||||||
cursor: "move"
|
cursor: "move"
|
||||||
|
|
@ -77,6 +76,6 @@ class HabitTracker.Views.Habits.IndexView extends Backbone.View
|
||||||
$.ajax
|
$.ajax
|
||||||
type: "post"
|
type: "post"
|
||||||
url: "/habits/sort"
|
url: "/habits/sort"
|
||||||
data: $(list_id).sortable("serialize")
|
data: $(this).sortable("serialize")
|
||||||
dataType: "script"
|
dataType: "script"
|
||||||
return this
|
return this
|
||||||
Loading…
Reference in a new issue