var BASE_URL = "http://padma.local/" var padmaLists = [] $(document).ready(function() { callPadma("/list/get", initLists); }); var padmaList = function(json) { this.listId = json.listId; this.description = json.description; this.iconId = json.iconId; this.iconPath = BASE_URL + this.iconId + "/poster.jpg"; this.title = json.title; this.html = this.getHtml(); this.init(); } padmaList.prototype.init = function() { var that = this; $('#lists').append(that.html); } padmaList.prototype.getHtml = function() { var that = this; var wrapperElem = $("
"); wrapperElem.addClass("listWrapper"); var titleElem = $(''); titleElem.attr("id", this.listId); titleElem.addClass("listTitle"); var titleHtml = "" + this.title + ""; titleElem.html(titleHtml); titleElem.hover(function() { $(this).next().show(); }, function() { $(this).next().hide(); }); wrapperElem.append(titleElem); var innerElem = $(''); innerElem.addClass("listDetail"); innerElem.hide(); var innerHtml = ''; innerHtml += "