Permalink
Browse files

Flip install button (bug 690574)

  • Loading branch information...
1 parent b9a780b commit 6d95cfaf3a2a5a2c3bb8cb7ce75b6be21d01e1a2 @gkoberger gkoberger committed Sep 30, 2011
Showing with 11 additions and 1 deletion.
  1. +1 −1 apps/addons/templates/addons/paypal_thanks.html
  2. +10 −0 media/js/zamboni/contributions.js
@@ -3,7 +3,7 @@
{% block classes %}paypal-modal{% endblock %}
{% block content %}
-<section class="paypal-parent">
+<section class="paypal-parent" id="addon_info" data-addon="{{ addon.id }}">
<h2>{{ _('Purchase Add-on') }}</h2>
<h5>{{ _('Thank you!') }}</h5>
{% trans addon_name=addon.name %}
@@ -42,6 +42,16 @@ $(document).ready(function() {
if(thanks_url) {
// TODO: play around with top.opener
top.modalFromURL(thanks_url, {'callback': function() {
+ // Change the add-on buttons
+ var context = $(this).closest('body'),
+ addon_id = $('#addon_info', this).attr('data-addon'),
+ install = $('.install[data-addon='+ addon_id +']', context);
+
+ install.removeClass('premium').find('.premium').removeClass('premium');
+ install.find('a').unbind('click')
+ install.installButton();
+
+ // Trigger install
z.installAddon($(".addon-title", this).text(),
$(".trigger_download", this).attr('href'));
}});

0 comments on commit 6d95cfa

Please sign in to comment.