Fixed JS error

Signed-off-by: Nathan Booth <nath.booth@gmail.com>
This commit is contained in:
Nathan Booth
2011-12-20 12:14:38 +00:00
parent 3481e1c7d6
commit 18dd7e2773

View File

@@ -4,35 +4,27 @@
* *
*/ */
var sb = { var sb = {
init: function() { init: function() {
$('.alert-data').alert(); $('.alert-data').alert();
$('.tabs').tabs() $('.tabs').tabs();
$("a[rel=popover]")
.popover({
offset: 10
})
.click(function(e) {
e.preventDefault()
})
})
}, },
usercp: { usercp: {
init: function() { init: function() {
$('#usercp_newpassword,#usercp_confirmpassword').bind('keyup', sb.usercp.checkPassword); $('#usercp_newpassword,#usercp_confirmpassword').bind('keyup', sb.usercp.checkPassword);
}, },
checkPassword: function() { checkPassword: function() {
password = $('#usercp_newpassword'); password = $('#usercp_newpassword');
confirm = $('#usercp_confirmpassword'); confirm = $('#usercp_confirmpassword');
confirm_container = confirm.parent().parent(); confirm_container = confirm.parent().parent();
if (password.val() == confirm.val()) { if (password.val() == confirm.val()) {
console.log("passwords match"); console.log("passwords match");
confirm_container.removeClass('error').addClass('success'); confirm_container.removeClass('error').addClass('success');
@@ -43,7 +35,19 @@ var sb = {
$('#usercp_confirmpassword_help').show(); $('#usercp_confirmpassword_help').show();
} }
} }
} }
}; };
$('document').ready(sb.init);
$(function () {
$("a[rel=popover]")
.popover({
offset: 10
})
.click(function(e) {
e.preventDefault()
})
})