app/assets/javascripts/admin/taxonomy.js.coffee in spree_backend-2.0.0 vs app/assets/javascripts/admin/taxonomy.js.coffee in spree_backend-2.0.1
- old
+ new
@@ -49,12 +49,12 @@
url: url.toString(),
data: {_method: "put", "taxon[name]": name },
error: handle_ajax_error
handle_delete = (e, data) ->
- last_rollback = data.rlb
- node = data.rslt.ob
+ last_rollback = data.rlbk
+ node = data.rslt.obj
delete_url = base_url.clone()
delete_url.setPath delete_url.path() + '/' + node.attr("id")
jConfirm Spree.translations.are_you_sure_delete, Spree.translations.confirm_delete, (r) ->
if r
$.ajax
@@ -68,22 +68,23 @@
last_rollback = null
root = exports ? this
root.setup_taxonomy_tree = (taxonomy_id) ->
if taxonomy_id != undefined
+ # this is defined within admin/taxonomies/edit
+ root.base_url = Spree.url(Spree.routes.taxonomy_taxons_path)
+
$.ajax
- url: '/api/taxonomies/' + taxonomy_id + '/jstree',
+ url: base_url.path().replace("/taxons", "/jstree"),
success: (taxonomy) ->
- # this is defined within admin/taxonomies/edit
- root.base_url = Spree.url(Spree.routes.taxonomy_taxons_path)
last_rollback = null
conf =
json_data:
data: taxonomy,
ajax:
url: (e) ->
- '/api/taxonomies/' + taxonomy_id + '/taxons/' + e.attr('id') + '/jstree'
+ base_url.path() + '/' + e.attr('id') + '/jstree'
themes:
theme: "apple",
url: "/assets/jquery.jstree/themes/apple/style.css"
strings:
new_node: new_taxon,