function checkDisabled(){
//empty the content of #disabledDivs and set an empty var to be used in the .each() to follow
$('#disabledDivs').html('');
var disabledContent = '';
//find each hidden .charlie and make a .disabledDiv for it
$('.charlie:hidden').each(function(){
var hideId = "#"+$(this).attr('id');
var insertHide = "<div class='disabledDiv'>"+hideId+"</div>";
disabledContent += insertHide;
});
//add all the disabled divs to #disabledDivs
$('#disabledDivs').html(disabledContent);
//!!!!!!!!!!!!!!! This is my Primary Concern... Other questions/friendly criticism is appreciated, as I am new to
//browser scripting/ programming in general, but Please advise regarding the question below !!!!!!!!!!!!!!!!!!
// The following seems necessary because there are no .disabledDiv on page load. It
// could also just be me not knowing enough. But it works, and I'll put it up on the
// jQuery Forums to see if I'm doing it dirty, or right.
if(disabledContent != ''){
$('.disabledDiv').bind('dblclick', function(){
var disabledId = $(this).text();
$(disabledId).resizable("option", "disabled", false);
$(disabledId).show();
})
}
}
//to disable a div on dblclick
$('.charlie').dblclick(function(){
var dblId = "#"+$(this).attr('id');
$(dblId).resizable("option","disabled",true);
$(this).hide();
checkMax(dblId);
checkDisabled();
});
To clarify: Everything works. I just feel as though the code is dirty (and want to be better), and especially dirty in the indicated .bind() on the spot in question. Any suggestions/answers are appreciated.
When I first used jQuery about a month ago, i fell in love with it (and have used it on most, if not all, sites I've worked on since)
I finally downloaded and started implementing the UI yesterday, and am already blown away by how useful it is. If you haven't used it yet, I would greatly recommend checking it out.