Commits

Alvaro Videla committed b96a31f

refactors side forms initialization

  • Participants
  • Parent commits 02bf2cf

Comments (0)

Files changed (1)

File public/javascripts/cloudstagram.js

     jQuery('#instance-tooltip').tooltip();
 }
 
+function initSideForms() {
+    jQuery('.show-form').click(function (event) {
+        var elem = jQuery(event.target);
+        swapSideForms(elem.attr('href').substring(1));
+        event.preventDefault();
+    });
+}
+
 /**
  * Swaps from the Login/Register forms.
  */
     initInstanceInfoTooltip();
 
     if (!loggedin) {
-        jQuery('.show-form').click(function (event) {
-            var elem = jQuery(event.target);
-            swapSideForms(elem.attr('href').substring(1));
-            event.preventDefault();
-        });
+        initSideForms();
     }
 
     if (loggedin) {