Skip to content

Instantly share code, notes, and snippets.

@kennyp
Created August 9, 2012 16:23
Show Gist options
  • Save kennyp/3305607 to your computer and use it in GitHub Desktop.
Save kennyp/3305607 to your computer and use it in GitHub Desktop.
Carzyness
diff --git a/themes/comporium/js/sales.js b/themes/comporium/js/sales.js
index 95e84f6..3c47286 100644
--- a/themes/comporium/js/sales.js
+++ b/themes/comporium/js/sales.js
@@ -201,10 +201,15 @@ var init = function ($, Complete, Cart, queue) {
this.registerEvents();
$('script[type="text/underscore-template"]').forEach(function (t) {
- var pn = $(t).parent(),
+ var parNo = t.parentNode,
render = $.template(t.innerHTML);
templates[functionify(t.id)] = function (obj) {
- pn.html(render(obj));
+ var out = render(obj);
+ try {
+ parNo.innerHTML = out;
+ } catch (e) {
+ $(parNo).html(out);
+ }
};
});
templates.checkoutButton = function (totals) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment