more JS formatting

This commit is contained in:
lfortin 2010-12-19 00:15:00 -05:00
parent 77c102cce6
commit 0393ac5a6f
6 changed files with 14 additions and 12 deletions

View file

@ -101,9 +101,10 @@ var AspectEdit = {
$.ajax({
type: "POST",
url: "/aspects/remove_from_aspect",
data:{
'person_id' : person_id,
'aspect_id' : person.attr('data-aspect_id') }
data: {
'person_id': person_id,
'aspect_id': person.attr('data-aspect_id')
}
});
}
person.fadeOut(400, function() {

View file

@ -14,8 +14,8 @@ $(document).ready(function() {
$("li", list).each( function() {
var element = $(this);
if( !element.text().match(query) ){
if( !element.hasClass('invis') ){
if( !element.text().match(query) ) {
if( !element.hasClass('invis') ) {
element.addClass('invis').fadeOut(100);
}
} else {
@ -40,8 +40,8 @@ $(document).ready(function() {
}
}
$(".aspect_badge[guid='"+json['aspect_id']+"']", ".aspects").remove();
$(this).parent().html(json['button_html']);
$(".aspect_badge[guid='" + json.aspect_id + "']", ".aspects").remove();
$(this).parent().html(json.button_html);
$(this).fadeTo(200,1);
});

View file

@ -5,7 +5,7 @@
$(document).bind("mobileinit", function() {
$.extend($.mobile, {
ajaxLinksEnabled : false,
ajaxFormsEnabled : false
ajaxLinksEnabled: false,
ajaxFormsEnabled: false
});
});

View file

@ -26,7 +26,7 @@ $(document).ready(function() {
$('.edit_photo').bind('ajax:success', function(data, json, xhr) {
json = $.parseJSON(json);
$(".edit_photo input[type='text']").val(json['photo']['caption']);
$(".edit_photo input[type='text']").val(json.photo.caption);
$("#caption").html(json.photo.caption);
$("#show_photo").find("img").fadeTo(200,1);
$("#photo_spinner").hide();

View file

@ -1,7 +1,6 @@
/* Clear form plugin - called using $("elem").clearForm(); */
$.fn.clearForm = function() {
return this.each(function() {
var type = this.type, tag = this.tagName.toLowerCase();
if ($(this).is('form')) {
return $(':input', this).clearForm();
}

View file

@ -22,7 +22,9 @@ var Validation = {
}
},
emailKeypress: function(evt) {
if(evt.keyCode === 0) { return; }
if(evt.keyCode === 0) {
return;
}
if(!Validation.rules.email.characters.test(this.value + String.fromCharCode(evt.keyCode))) {
$('#user_email').css('border-color', '#8B0000');
} else {