Shorter, Cleaner JS in apps.js

This commit is contained in:
raghunayyar 2013-01-31 11:52:56 +05:30
parent 0dfbd53a6e
commit b978cc8b28
1 changed files with 4 additions and 8 deletions

View File

@ -109,16 +109,12 @@ OC.Settings.Apps = OC.Settings.Apps || {
var container = $('#apps'); var container = $('#apps');
if(container.children('li[data-id="'+entry.id+'"]').length === 0){ if(container.children('li[data-id="'+entry.id+'"]').length === 0){
var li=$('<li></li>'); var li=$('<li></li>').attr({class: 'enabled-app'});
var img =$('<img></img>');
li.attr('data-id', entry.id); li.attr('data-id', entry.id);
li.attr('class', 'enabled-app'); var img= $('<img></img>').attr({ src: entry.icon, class:'icon'});
img.attr('src', entry.icon);
img.attr('class', 'icon');
li.append(img); li.append(img);
var a=$('<a></a>'); var a=$('<a></a>').attr('href', entry.href);
a.text(entry.name); a.text(entry.name);
a.attr('href', entry.href);
li.append(a); li.append(a);
container.append(li); container.append(li);
} }