tweak the jquery

This commit is contained in:
Jonathan Corwin 2011-05-21 10:14:30 +01:00
parent 732f5321dd
commit 218ee2db2b

View File

@ -219,14 +219,12 @@ window.OpenLP = {
} }
else { else {
$.each(data.results.items, function (idx, value) { $.each(data.results.items, function (idx, value) {
var li = $("<li><ul>").text(value[1]); var item = $("<li>").text(value[1]);
li.append($("<ul><li><a id=\"go-live\" href=\"#\">Go Live</a></li>" + var golive = $("<a href=\"#\">Go Live</a>").attr("value", value[0]).click(OpenLP.goLive);
"<li><a id =\"add-service\" href=\"#\">Add To Service</a></li></ul>")); var additem = $("<a href=\"#\">Add To Service</a>").attr("value", value[0]).click(OpenLP.addToService);
li.find("a").attr("value", value[0]); item.append($("<ul>").append($("<li>").append(golive)).append($("<li>").append(additem)));
ul.append(li); ul.append(item);
}); });
ul.find("#go-live").click(OpenLP.goLive);
ul.find("#add-service").click(OpenLP.addToService);
} }
ul.listview("refresh"); ul.listview("refresh");
} }