Skip to content

Commit

Permalink
make the list draggable
Browse files Browse the repository at this point in the history
  • Loading branch information
tswicegood committed Aug 5, 2011
1 parent c4cc2ba commit cfe57bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ListItemView = Backbone.View.extend
template: _.template($("#list-item-template").html())

render: ->
@$(@el).html(@template @model.toJSON())
@$(@el).html(@template @model.toJSON()).addClass "ui-state-default"
@setContent
@

Expand All @@ -49,7 +49,9 @@ App = Backbone.View.extend
return

render: ->
# TODO: determine what (if anything to do)
@destination.sortable
placeholder: "ui-state-highlight"
@destination.disableSelection()

addOne: (item) ->
view = new ListItemView model: item
Expand Down
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<link type="text/css" href="vendor/jquery-ui-1.8.14.custom/css/ui-lightness/jquery-ui-1.8.14.custom.css" rel="stylesheet" />
</head>

<body>
Expand All @@ -18,6 +19,8 @@ <h1>Hello!</h1>
<script type="text/javascript" src="vendor/backbone/backbone.js"></script>
<script type="text/coffeescript" src="index.coffee"></script>
<script type="text/javascript" src="vendor/coffeescript/extras/coffee-script.js"></script>
<script type="text/javascript" src="vendor/jquery-ui-1.8.14.custom/js/jquery-ui-1.8.14.custom.min.js"></script>


<script type="text/template" id="list-item-template">
<div class="item">
Expand Down

0 comments on commit cfe57bb

Please sign in to comment.