mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-13 17:52:22 +00:00
Refactored coffee script
This commit is contained in:
parent
ae9e9b0757
commit
f131c2bc40
1 changed files with 17 additions and 35 deletions
|
|
@ -3,40 +3,22 @@
|
||||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||||
|
|
||||||
$(document).ready ->
|
$(document).ready ->
|
||||||
$("#habits").sortable
|
$.each ['#habits', '#daily'], (index, list_id) ->
|
||||||
axis: "y"
|
$(list_id).sortable
|
||||||
dropOnEmpty: false
|
axis: "y"
|
||||||
cursor: "move"
|
dropOnEmpty: false
|
||||||
items: "li"
|
cursor: "move"
|
||||||
opacity: 0.4
|
items: "li"
|
||||||
scroll: true
|
opacity: 0.4
|
||||||
update: ->
|
scroll: true
|
||||||
$.ajax
|
update: ->
|
||||||
type: "post"
|
$.ajax
|
||||||
data: $("#habits").sortable("serialize")
|
type: "post"
|
||||||
dataType: "script"
|
url: "/habits/sort"
|
||||||
complete: (request) ->
|
data: $(list_id).sortable("serialize")
|
||||||
$("#habits").effect "highlight"
|
dataType: "script"
|
||||||
|
complete: (request) ->
|
||||||
url: "/habits/sort"
|
$(list_id).effect "highlight"
|
||||||
|
|
||||||
$(document).ready ->
|
|
||||||
$("#daily").sortable
|
|
||||||
axis: "y"
|
|
||||||
dropOnEmpty: false
|
|
||||||
cursor: "move"
|
|
||||||
items: "li"
|
|
||||||
opacity: 0.4
|
|
||||||
scroll: true
|
|
||||||
update: ->
|
|
||||||
$.ajax
|
|
||||||
type: "post"
|
|
||||||
data: $("#daily").sortable("serialize")
|
|
||||||
dataType: "script"
|
|
||||||
complete: (request) ->
|
|
||||||
$("#daily").effect "highlight"
|
|
||||||
|
|
||||||
url: "/habits/sort"
|
|
||||||
|
|
||||||
(($) ->
|
(($) ->
|
||||||
$.fn.highlight = ->
|
$.fn.highlight = ->
|
||||||
|
|
@ -45,4 +27,4 @@ $(document).ready ->
|
||||||
background: "yellow"
|
background: "yellow"
|
||||||
|
|
||||||
$(this).fadeIn()
|
$(this).fadeIn()
|
||||||
) jQuery
|
) jQuery
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue