From fce59b408583470041b25fd8c0d6b94856ae921f Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Mon, 18 May 2009 16:32:41 -0300 Subject: [PATCH] ActionItem1020: adding a class to the lightbox --- app/views/home/index.rhtml | 2 +- public/javascripts/lightbox.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/home/index.rhtml b/app/views/home/index.rhtml index 55b9c09..f3fd6c6 100644 --- a/app/views/home/index.rhtml +++ b/app/views/home/index.rhtml @@ -1,5 +1,5 @@ <% if environment.enabled?('display_wizard_signup') && !logged_in? %> - <%= lightbox_button(:new, _('Signup'), { :controller => 'account', :action => 'wizard' }, :class => 'wizard') %> + <%= lightbox_button(:new, _('Signup'), { :controller => 'account', :action => 'wizard' }, :class => 'wizard', :id => 'signup-wizard') %> <% end %> <% if @has_news %> diff --git a/public/javascripts/lightbox.js b/public/javascripts/lightbox.js index 79247b4..19400a2 100644 --- a/public/javascripts/lightbox.js +++ b/public/javascripts/lightbox.js @@ -64,6 +64,9 @@ lightbox.prototype = { initialize: function(ctrl) { this.content = ctrl.href; + if (ctrl.id != '') { + this.lightbox_className = ctrl.id; + } Event.observe(ctrl, 'click', this.activate.bindAsEventListener(this), false); ctrl.onclick = function(){return false;}; }, @@ -146,7 +149,11 @@ lightbox.prototype = { processInfo: function(response){ info = "
" + response.responseText + "
"; new Insertion.Before($('lbLoadMessage'), info) - $('lightbox').className = "done"; + if (this.lightbox_className) { + $('lightbox').className = "done " + this.lightbox_className; + } else { + $('lightbox').className = "done"; + } this.actions(); }, -- libgit2 0.21.2