Skip to content

Commit f69ed46

Browse files
committed
Animations for all
1 parent e2a3fc0 commit f69ed46

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

js/app.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
tryit = example.find('.tryit'),
2020
inputs = modal.find('.modal-body :input'),
2121
requiredInputs = modal.find('[required="required"]'),
22-
input, merchant, el, len, i, key;
22+
input, merchant, el, len, i, key, button;
2323

2424

2525
// Don't update if we don't have all of the required inputs
@@ -65,8 +65,17 @@
6565
code.text(el.outerHTML.replace(/data-/g, "\n data-").replace("></" + "script>", "\n></" + "script>"));
6666

6767
// Update the button
68+
button = PAYPAL.apps.ButtonFactory.create(data.business.value, data, data.button.value);
69+
button = $(button);
70+
button.css('display', 'none');
71+
6872
tryit.empty();
69-
PAYPAL.apps.ButtonFactory.create(data.business.value, data, data.button.value, tryit[0]);
73+
tryit.append(button);
74+
tryit.animate({
75+
height: (button.height() || 130) * 2
76+
}, 300, function () {
77+
button.fadeTo(300, 1);
78+
});
7079

7180
// Close the modal
7281
modal.modal('hide');

0 commit comments

Comments
 (0)