From 18dd7e2773b881ad98b35e0b25ea4165a8a3542b Mon Sep 17 00:00:00 2001 From: Nathan Booth Date: Tue, 20 Dec 2011 12:14:38 +0000 Subject: [PATCH] Fixed JS error Signed-off-by: Nathan Booth --- public/scripts/main.js | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/public/scripts/main.js b/public/scripts/main.js index ab10271..ff4ad46 100644 --- a/public/scripts/main.js +++ b/public/scripts/main.js @@ -4,35 +4,27 @@ * */ + var sb = { - + init: function() { $('.alert-data').alert(); - $('.tabs').tabs() - $("a[rel=popover]") - .popover({ - offset: 10 - }) - .click(function(e) { - e.preventDefault() - }) - - }) + $('.tabs').tabs(); }, - + usercp: { - + init: function() { $('#usercp_newpassword,#usercp_confirmpassword').bind('keyup', sb.usercp.checkPassword); - + }, - + checkPassword: function() { password = $('#usercp_newpassword'); confirm = $('#usercp_confirmpassword'); - + confirm_container = confirm.parent().parent(); - + if (password.val() == confirm.val()) { console.log("passwords match"); confirm_container.removeClass('error').addClass('success'); @@ -43,7 +35,19 @@ var sb = { $('#usercp_confirmpassword_help').show(); } } - + } - + }; + +$('document').ready(sb.init); + + $(function () { + $("a[rel=popover]") + .popover({ + offset: 10 + }) + .click(function(e) { + e.preventDefault() + }) + }) \ No newline at end of file