projects
/
mkws-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1466739
)
Change to use a dropdown for categories instead of a bullet-list.
author
Mike Taylor
<mike@indexdata.com>
Tue, 22 Apr 2014 12:52:00 +0000
(13:52 +0100)
committer
Mike Taylor
<mike@indexdata.com>
Tue, 22 Apr 2014 12:52:00 +0000
(13:52 +0100)
src/mkws-widget-categories.js
patch
|
blob
|
history
diff --git
a/src/mkws-widget-categories.js
b/src/mkws-widget-categories.js
index
afb3875
..
4d2f7e7
100644
(file)
--- a/
src/mkws-widget-categories.js
+++ b/
src/mkws-widget-categories.js
@@
-19,16
+19,14
@@
mkws.registerWidgetType('Categories', function() {
that.log("got categories: " + data);
var text = [];
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();
$(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(''));
});
});
$(that.node).html(text.join(''));
});
});