X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fpeta%2Fitem.js.coffee;h=c11b572d77f2ba7acdc68e272a8855fcd9cd5764;hp=f5fa53bf40ce40db4646889a7abc8face366760a;hb=d7c8065be895b67dc453b0e11ad0f259f1ca6706;hpb=e05f18d1db38e531e7bca45d4ba8db71b082402f diff --git a/app/assets/javascripts/peta/item.js.coffee b/app/assets/javascripts/peta/item.js.coffee index f5fa53bf..c11b572d 100644 --- a/app/assets/javascripts/peta/item.js.coffee +++ b/app/assets/javascripts/peta/item.js.coffee @@ -153,6 +153,8 @@ class Peta.Item extends Backbone.Model @fetch_association(route, cxt, { success: (association_item, options) => options.success.call(context, association_item) + fail: (response, opt) => + options.fail.call(context, response, opt) context: context, options: options }) @@ -161,6 +163,8 @@ class Peta.Item extends Backbone.Model @fetch_association(route, this, { success: (association_item, options) => association_item.get_association(routes, this, options) + fail: (response, opt) => + options.fail.call(context, response, opt) context: context, options: options }) @@ -170,6 +174,8 @@ class Peta.Item extends Backbone.Model fetch_options = { success: (association_item) => options.success.call(context, association_item, options.options) + fail: (response, opt) => + options.fail.call(context, response, opt) } if a.belongs_to[name] @get_parent(name, context, fetch_options) @@ -199,6 +205,8 @@ class Peta.Item extends Backbone.Model callback = options.success item = items[0] callback.call(context, item) + fail: (response, opt) => + options.fail.call(context, response, opt) }) get_children: (has_many_name, context, options = null) -> @@ -207,6 +215,8 @@ class Peta.Item extends Backbone.Model success: (items) => callback = options.success callback.call(context, items) + fail: (response, opt) => + options.fail.call(context, response, opt) }) has_many: (has_many_name) -> @@ -232,6 +242,8 @@ class Peta.Item extends Backbone.Model @get_association(routes, this, { success: (association) => options.success.call(context, association) + fail: (response, opt) => + options.fail.call(context, response, opt) }) boosts: (level) -> @@ -305,6 +317,8 @@ class Peta.Item extends Backbone.Model @trace_to('symbol', this, { success: (symbol_item) => options.success.call(context, symbol_item.symbol_file()) + fail: (response, opt) => + options.fail.call(context, response, opt) }) @face_file: () ->