From 5a6cbea2619badc1c1451be2b448115a7d38be5a Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 4 Nov 2014 17:28:35 +0100 Subject: [PATCH] drop listview.js * isn't used in core and isn't mentioned in documentation --- core/js/listview.js | 71 --------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 core/js/listview.js diff --git a/core/js/listview.js b/core/js/listview.js deleted file mode 100644 index 71466c9020..0000000000 --- a/core/js/listview.js +++ /dev/null @@ -1,71 +0,0 @@ -function ListView(element){ - this.element=element; -} - -ListView.generateTable=function(collumns){ - var html=''; - html+=''; - $.each(collumns,function(index,collumn){ - html+=''; - }); - html+=''; - html+=''; - html+=''; - html+=''; - $.each(collumns,function(index,collumn){ - html+=''; - html+=''; - html='
'+collumn+'
'; - }); - html+='
'; - return $(html); -}; - -ListView.prototype={ - rows:{}, - hoverElements:{}, - addRow:function(id,data,extraData){ - var tr=this.element.find('tr.template').clone(); - tr.removeClass('template'); - $.each(data,function(name,value){ - tr.children('td.'+name).text(value); - tr.attr('data-'+name,value); - }); - $.each(extraData,function(name,value){ - tr.attr('data-'+name,value); - }); - this.rows[id]=data; - tr.data('id',id); - this.element.children('tbody').append(tr); - }, - removeRow:function(id){ - this.rows[id].remove(); - delete this.rows[id]; - }, - hoverHandeler:function(tr){ - $.each(this.hoverElement,function(index,collumn){ - $.each(collumn,function(index,element){ - var html=''; - element = $(html); - element.append($('')); - element.click(element.callback); - tr.children('td.'+collumn).append(element); - }); - }); - if(this.deleteCallback){ - - } - }, - hoverHandelerOut:function(tr){ - tr.find('*.hoverElement').remove(); - }, - addHoverElement:function(column,icon,title,callback){ - if(!this.hoverElements[column]){ - this.hoverElements[column] = []; - } - this.hoverElements[row].push({icon:icon,callback:callback,title:title}); - }, - empty:function(){ - this.element.children('tr:not(.template)').remove(); - } -};