diff --git a/app/assets/javascripts/mapknitter/Map.js b/app/assets/javascripts/mapknitter/Map.js index c3d4fb373..926e2f2ae 100644 --- a/app/assets/javascripts/mapknitter/Map.js +++ b/app/assets/javascripts/mapknitter/Map.js @@ -499,6 +499,9 @@ MapKnitter.Map = MapKnitter.Class.extend({ beforeSend: function (e) { $('.mk-save').removeClass('fa-check-circle fa-times-circle fa-green fa-red').addClass('fa-spinner fa-spin') }, + success: function(data) { + App.concurrent_editing.speak(data); + }, complete: function (e) { $('.mk-save').removeClass('fa-spinner fa-spin').addClass('fa-check-circle fa-green') }, diff --git a/app/controllers/images_controller.rb b/app/controllers/images_controller.rb index af14b8ec7..97518a19d 100644 --- a/app/controllers/images_controller.rb +++ b/app/controllers/images_controller.rb @@ -93,7 +93,8 @@ def update @warpable.locked = params[:locked] @warpable.cm_per_pixel = @warpable.get_cm_per_pixel @warpable.save - render html: 'success' + data = Map.fetch_map_data + render json: data end def destroy diff --git a/app/models/map.rb b/app/models/map.rb index 2bd9d6c3a..5e87e3abb 100755 --- a/app/models/map.rb +++ b/app/models/map.rb @@ -267,4 +267,9 @@ def add_tag(tagname, user) tagname = tagname.downcase tags.create(name: tagname, user_id: user.id, map_id: id) unless has_tag(tagname) end + + def self.fetch_map_data + data = {} + data + end end