$('#listLeft ul li a').live("click", function() { // alert("foo"); // e.preventDefault(); if ($(this).hasClass("listLeftSelected")) { return false; } $('.listLeftSelected').removeClass("listLeftSelected"); $(this).addClass('listLeftSelected'); var objId = $(this).attr("data-id"); var tabId = $('.innerSelected').attr("data-id"); $.getJSON("/m/get_details", { 'tab_id': tabId, 'object_id': objId }, function(data) { $('#textRight').text(data.title); $('#bottomRight').html(data.html); // console.log(data); }); return false; }); /* Get a jquery ').val(s.operator + s.field_name).text(s.friendly_name); } /* Get a Jquery List Row object for an item - requires item.id and item.title*/ function getLi(item) { var titleLength = 30; var $li = $('
').addClass("tabListItem"); var $a = $('').attr("href", '#').attr("data-id", item.id).appendTo($li); // console.log(item.title.length); var $span = $('').text(item.title).appendTo($a); return $li; } $(function() { /* search button toggle */ $('.searchInnerField').hide(); $('#searchInner').toggle(function() { $('.searchInnerField').slideDown(); }, function() { $('.searchInnerField').slideUp(); }); /* search button end */ $('#listLeft ul li a').eq(0).click(); // alert("hi"); $('.tabCategory').click(function() { var $this = $(this); if ($this.hasClass('.innerSelected')) { return false; } $('.innerSelected').removeClass("innerSelected"); $this.addClass("innerSelected"); $('.displayedTab').removeClass("displayedTab"); var tabId = $this.attr("data-id"); $('#tabText_' + tabId).addClass("displayedTab"); doListLoading(); $.getJSON("/m/get_tab", { 'tab_id': tabId, // 'page_no': 1 }, function(data) { // $('#loadingList').hide(); stopListLoading(data.page); /* begin if for has_list, ideally make into separate render function */ // if (data.has_list) { /* handle sort options on list */ $select = $('#orderBySelect'); $select.empty(); var sorts = data.sorts; if (sorts.length == 0) { $select.hide(); } else { $select.show(); } for (var j=0; j