Change to use a dropdown for categories instead of a bullet-list.
authorMike Taylor <mike@indexdata.com>
Tue, 22 Apr 2014 12:52:00 +0000 (13:52 +0100)
committerMike Taylor <mike@indexdata.com>
Tue, 22 Apr 2014 12:52:00 +0000 (13:52 +0100)
src/mkws-widget-categories.js

index afb3875..4d2f7e7 100644 (file)
@@ -19,16 +19,14 @@ mkws.registerWidgetType('Categories', function() {
            that.log("got categories: " + data);
 
             var text = [];
-            text.push("<p><b>Categories for " + realm + "</b></p>");
-            text.push("<ul>");
+            text.push("Select category: ");
+            text.push("<select name='mkwsCategory' onchange='alert(1)'>");
             $(data).find('category').each(function() {
                 var name = $(this).find('categoryName').text();
                 var id = $(this).find('categoryId').text();
-                text.push("<li>");
-                text.push('<a href="#" onclick="mkws.setCategory(' + "'" + id + "'" + ')">' + name + '</a>');
-                text.push("</li>");
+                text.push("<option value='", id, "'>", name, "</option>");
             });
-            text.push("</ul>");
+            text.push("</select>");
            $(that.node).html(text.join(''));
        });
     });