$('#fkcontainer').append('<div id="root" />');
jQuery.ppa = {
- root: $('#root'),
+ root: $('#root')
};
$("a.fk").live('click', function (event) {
/* creating the data div */
newdiv = $('<div class="fk '+divclass+'">').html(answer);
+ /* highlight referencing fields */
+ newdiv.data('ref', this).data('refclass', $(this).attr('class').split(' ')[1])
+ .mouseenter(function (event) {
+ $(this).data('ref').closest('tr').find('a.'+$(this).data('refclass')).closest('div').addClass('highlight');
+ })
+ .mouseleave(function (event) {
+ $(this).data('ref').closest('tr').find('a.'+$(this).data('refclass')).closest('div').removeClass('highlight');
+ });
+
/* appending it to the level-1 div */
pdiv.append(newdiv);
},
});
$(".fk_delete").live('click', function (event) {
- $(this).closest('div').remove();
+ with($(this).closest('div')) {
+ data('ref').closest('tr').find('a.'+data('refclass')).closest('div').removeClass('highlight');
+ remove();
+ }
return false; // do not refresh the page
});
});
div.fk_value {
display:inline-block;
}
+.highlight {
+ background-color: #FFFF00;
+}
/** Syntax highlighting **/
.comment {color: #008080}
.keyword {color: #FF8000}