Permalink
Browse files

using Widget.after_add in the twitter now to catch events on root.

  • Loading branch information...
1 parent ee588f2 commit 514ec73456fde4e0314a159853f7fe0d0491106e @apotonick committed Sep 23, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −0 app/cells/twitter_widget.rb
  2. +0 −1 app/controllers/dashboard_controller.rb
@@ -1,6 +1,10 @@
class TwitterWidget < Apotomo::Widget
responds_to_event :submit, :with => :process_tweet
+ after_add do |me, parent|
+ me.root.respond_to_event :tweetDeleted, :with => :redraw, :on => me.name
+ end
+
def display_form
@tweets = Tweet.find(:all)
render
@@ -4,7 +4,6 @@ class DashboardController < ApplicationController
has_widgets do |root|
root << widget(:twitter_widget, 'parrot', :display_form)
root << widget(:trashbin_widget, 'bin', :display)
- root.respond_to_event :tweetDeleted, :with => :redraw, :on => 'parrot'
end
def index

0 comments on commit 514ec73

Please sign in to comment.