]> source.dussan.org Git - nextcloud-server.git/commitdiff
Shorter, Cleaner JS in apps.js
authorraghunayyar <me@iraghu.com>
Thu, 31 Jan 2013 06:22:56 +0000 (11:52 +0530)
committerraghunayyar <me@iraghu.com>
Thu, 31 Jan 2013 06:22:56 +0000 (11:52 +0530)
settings/js/apps.js

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