var MultiListSingle = { init: false, init: function() { if (this.initialized) return; this.initialized = true; this.s_lists(); }, s_lists: function() { this.s_lists_sortable(); this.s_lists_del_item(); this.s_lists_add(); }, s_lists_update: function() { this.s_lists_maxid(); this.s_lists_del_item(); AveAdmin.tooltip(); }, s_lists_maxid: function(id) { var maxid = 1; $('#multi_lists_single_' + id).children('.multi_list_single').each(function() { maxid = Math.max(maxid, parseInt($(this).attr("data-id")) + 1); }); return maxid; }, s_lists_del_item: function() { $('.multi_list_single .DelSingleButton').on('click', function(event) { event.preventDefault(); var id = $(this).attr('data-id'); jConfirm( s_list_del_conf, s_list_del_head, function(b) { if (b) { $('#list_' + id).remove(); } } ); }); }, s_lists_add: function() { $('.AddSingleButton').on('click', function(event) { event.preventDefault(); c_id = $(this).parent().parent('.multi_lists_single').attr("data-id"); iid = MultiListSingle.s_lists_maxid(c_id); $('#multi_lists_single_' + c_id + ':last').append( '