Sha256: 37538870344898849ca5b1642aa220c3167b72f03c7ed63bf47e277bcb8db4a0
Contents?: true
Size: 816 Bytes
Versions: 8
Compression:
Stored size: 816 Bytes
Contents
$(function(){ $("td.with-nested-list a, tr.with-nested-list").live("click",function(event){ event.preventDefault() var was_active = $(this).data("active") $("td.with-nested-list a, tr.with-nested-list").data("active",false) $(this).data("active",true) if($(this).prop("tagName") == "A"){ var $tr = $(this).parents("tr").eq(0) var url = $(this).parent().data("nested-list-url") }else{ $tr = $(this) url = $(this).data("nested-list-url") } if(was_active && $tr.next().hasClass("nested-list")){ $tr.next().remove() $(this).data("active",false) }else{ $.get(url,function(data){ if($tr.next().hasClass("nested-list")){ $tr.next().replaceWith(data) }else{ $tr.after(data) } }) } }) })
Version data entries
8 entries across 8 versions & 1 rubygems