kareila: (Default)
kareila ([personal profile] kareila) wrote in [site community profile] changelog2010-03-08 05:51 pm

[dw-free] JS missing from /update and /editjournal

[commit: http://hg.dwscoalition.org/dw-free/rev/ef99e212a4c3]

http://bugs.dwscoalition.org/show_bug.cgi?id=2316

Don't initialize the xpost JS if we don't have an update form.

Patch by [personal profile] afuna.

Files modified:
  • htdocs/js/xpost.js
--------------------------------------------------------------------------------
diff -r 3b7a5e7d6339 -r ef99e212a4c3 htdocs/js/xpost.js
--- a/htdocs/js/xpost.js	Mon Mar 08 10:20:42 2010 +0000
+++ b/htdocs/js/xpost.js	Mon Mar 08 11:51:34 2010 -0600
@@ -194,6 +194,8 @@ XPostAccount.loadAccounts = function () 
 // this requires md5.js
 XPostAccount.setUpXpostForm = function () {
   var updateForm = document.getElementById('updateForm');
+  if ( ! updateForm ) return;
+
   DOM.addEventListener(updateForm, "submit", XPostAccount.xpostFormSubmitted.bindEventListener(updateForm));
   XPostAccount.loadAccounts();
   XPostAccount.xpostAcctUpdated();
--------------------------------------------------------------------------------