Permalink
Browse files

Use local collection variable

  • Loading branch information...
nagisa committed Jul 4, 2012
1 parent 11d8bc7 commit 7b1084ddb7834fb19d944d6776029b7f674b0cfb
Showing with 4 additions and 3 deletions.
  1. +4 −3 django_bfm/static/django_bfm/src/directories.coffee
@@ -10,22 +10,22 @@ class Directory extends Backbone.Model
$.ajax({
'url': @url,
'data': _.extend(data, additional_data),
- 'success': ()-> DirectoryBrowser.directories.fetch()
+ 'success': ()=> @collection.fetch()
})
rename: (data)->
additional_data = {'action': 'rename', 'directory': @get('rel_dir')}
$.ajax({
'url': @url,
'data': $.extend(data, additional_data),
- 'success': ()-> DirectoryBrowser.directories.fetch()
+ 'success': ()=> @collecion.fetch()
})
delete: (data)->
$.ajax({
url: @url,
data: {'action': 'delete', 'directory': @get('rel_dir')},
- success: ()-> DirectoryBrowser.directories.fetch()
+ success: ()=> @collection.fetch()
})
@@ -36,6 +36,7 @@ class DirectoryCollection extends Backbone.Collection
initialize: ()->
@on('reset', @added)
@root = new Directory({name: '', rel_dir: ''})
+ @root.collection = @
added: ()->
@view.clear()

0 comments on commit 7b1084d

Please sign in to comment.