Skip to content

Commit

Permalink
redbox can use RJS
Browse files Browse the repository at this point in the history
  • Loading branch information
jadehopepunk committed Dec 18, 2007
1 parent dec3e37 commit a642932
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions javascripts/redbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ var RedBox = {
{
this.removeChildrenFromNode($('RB_window'));
this.moveChildren($(id), $('RB_window'));
this.activateRBWindow();
},

activateRBWindow: function()
{
Element.hide('RB_loading');
new Effect.Appear('RB_window', {duration: 0.4, queue: 'end'});
this.setWindowPosition();
Expand Down
10 changes: 7 additions & 3 deletions lib/redbox_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ def build_hidden_content(hidden_content_id)
end

def redbox_remote_options(remote_options, hidden_content_id)
remote_options[:update] = hidden_content_id
remote_options[:loading] = "RedBox.loading(); " + remote_options[:loading].to_s
remote_options[:complete] = "RedBox.addHiddenContent('#{hidden_content_id}'); " + remote_options[:complete].to_s
remote_options[:update] = hidden_content_id unless remote_options.key?(:update)
remote_options[:loading] = "RedBox.loading();" + remote_options[:loading].to_s
if remote_options[:update]
remote_options[:complete] = "RedBox.addHiddenContent('#{hidden_content_id}'); " + remote_options[:complete].to_s
else
remote_options[:complete] = "RedBox.activateRBWindow(); " + remote_options[:complete].to_s
end
remote_options
end

Expand Down

0 comments on commit a642932

Please sign in to comment.