Sorry for a large snippet, I could not localize the problem well.
In the snippet below IE doesn't extend HTML elements right.
Try to load the sample and click an image. The group should be removed.
For empty group it works well, but for non-empty group I get an error.
Elements have property _extended==true, but all the additional methods are missing.
I use prototype 1.5.0 and IE6, IE7 for Windows.
The snippet works as intended in FF2 and Opera 9.
For now I've modified Element.extend in my copy of prototype, so that it checks the presence of element.toggle instead of element._extended.
Btw the site is very very slow. And I can't find how do I attach files.
So here is it:
<script src="prototype.js">// version. 1.5.0</script>
<script>
function initCl() {
contacts.each(function(contact){
moveContact(contact.value.id, contact.value.group);
});
addGroup('comeon');
}
function moveContact(contactId, groupName) {
$('cl_group_'+groupName) || addGroup(groupName);
$('cl_contacts_'+groupName).innerHTML+= (
'<div class="contact" id="cl_contact_'+contactId+'">' +
contacts[contactId].nick +
'</div>'
);
}
function addGroup(groupName) {
$('cl').innerHTML+= (
'<div class="cl_group" id="cl_group_'+groupName+'">' +
'<div class="cl_fold">' +
'<span>'+groupName+'</span>' +
'<img class="removeGroup" onclick="removeGroup(\''+groupName+'\');">' +
'</div>' +
'<div class="cl_contacts" id="cl_contacts_'+groupName+'"></div>' +
'</div>'
);
}
function removeGroup(groupName) {
$('cl_group_' + groupName).remove();
}
contacts = $H({
1341:{id: 1341, nick: 'alisey', group: 'parasya'},
1342:{id: 1342, nick: 'sabak', group: 'parasya'},
1343:{id: 1343, nick: 'kisya', group: 'parasya'}
});
Event.observe(window, 'load', initCl);
</script>
<div id="cl"></div>