Skip to content

Commit

Permalink
Moved .live(...) into $(function() {}) block - DOM logic should not b…
Browse files Browse the repository at this point in the history
…e left to synchronously execute outside of a DOMContentLoaded closure
  • Loading branch information
rwaldron authored and Maxwell Salzberg committed Sep 18, 2010
1 parent 1f2592d commit 7738393
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions public/javascripts/aspect-edit.js
Expand Up @@ -3,18 +3,6 @@
* the COPYRIGHT file.
*/


$('#move_friends_link').live( 'click', function(){
$.post('/aspects/move_friends',
{ 'moves' : $('#aspect_list').data() },
function(){ $('#aspect_title').html("Groups edited successfully!");});

$(".person").css('background-color','none');
$('#aspect_list').removeData();
$(".person").attr('from_aspect_id', function(){return $(this).parent().attr('id')})

});

function decrementRequestsCounter(){
var old_request_count = $(".new_requests").html().match(/\d+/);

Expand All @@ -30,6 +18,19 @@ function decrementRequestsCounter(){
}

$(function() {


$('#move_friends_link').live( 'click', function(){
$.post('/aspects/move_friends',
{ 'moves' : $('#aspect_list').data() },
function(){ $('#aspect_title').html("Groups edited successfully!");});

$(".person").css('background-color','none');
$('#aspect_list').removeData();
$(".person").attr('from_aspect_id', function(){return $(this).parent().attr('id')})

});

$("ul .person").draggable({
revert: true
});
Expand Down

0 comments on commit 7738393

Please sign in to comment.