Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switch state of public page to *pending* when a widget name is changed

Signed-off-by: Toni Reina <areina0@gmail.com>
  • Loading branch information...
commit fdceab1abb487dd194f65366453325000869d6b5 1 parent 9d85937
Jon de Andres authored areina committed
Showing with 15 additions and 1 deletion.
  1. +15 −1 app/controllers/ubiquo/widgets_controller.rb
View
16 app/controllers/ubiquo/widgets_controller.rb
@@ -98,7 +98,21 @@ def update
def change_name
@widget = Widget.find(params[:id])
@widget.update_attributes(:name => params[:value])
- render :inline => @widget.name
+ respond_to do |format|
+ format.js do
+ js_response = render_to_string :update do |page|
+ self.uhook_extra_rjs_on_update(page, true) do |page|
+ page << 'myLightWindow.deactivate();'
+ page.replace_html("page_info", :partial => 'ubiquo/designs/pageinfo_sidebar',
+ :locals => { :page => @page.reload })
+ page.call "update_error_on_widgets", @page.wrong_widgets_ids
+ page.replace_html("widget_name_field_#{@widget.id}", @widget.name)
+ end
+ end
+
+ render :inline => "<%= javascript_tag(#{js_response.to_json}) %>", :locals => {:js_response => js_response }
+ end
+ end
end
def change_order
Please sign in to comment.
Something went wrong with that request. Please try again.