Files
wisemapping-open-source/wise-webapp/src/main/webapp/js/labelActions.js

25 lines
712 B
JavaScript
Raw Normal View History

2014-01-28 00:28:42 -03:00
function createLabelItem(data) {
$("#foldersContainer").find("ul").append(
$("<li data-filter=\"" + data.title + "\">").append(
"<a href=\"#\"> <i class=\"icon-tag\"></i>" + data.title + "</a>"
)
)
}
function fetchLabels() {
jQuery.ajax("c/restful/labels/", {
async:false,
dataType:'json',
type:'GET',
success:function (data) {
var labels = data.labels;
for (var i = 0; i < labels.length; i++) {
createLabelItem(labels[i])
}
},
error:function (jqXHR, textStatus, errorThrown) {
$('#messagesPanel div').text(errorThrown).parent().show();
}
});
}