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

31 lines
888 B
JavaScript
Raw Normal View History

2014-01-28 00:28:42 -03:00
function createLabelItem(data) {
2014-01-28 01:17:49 -03:00
if (data.color == "") {
data.color = "#000000";
}
2014-01-28 00:28:42 -03:00
$("#foldersContainer").find("ul").append(
$("<li data-filter=\"" + data.title + "\">").append(
2014-01-28 01:17:49 -03:00
"<a href=\"#\"> <i class=\"icon-tag\"></i>" +
"<div class='labelColor' style='background: " + data.color + "'></div>" +
"<div class='labelName'>" + data.title + "</div>" +
"</a>"
2014-01-28 00:28:42 -03:00
)
)
2014-01-28 01:17:49 -03:00
2014-01-28 00:28:42 -03:00
}
2014-01-28 02:58:39 -03:00
function fetchLabels(options) {
2014-01-28 00:28:42 -03:00
jQuery.ajax("c/restful/labels/", {
async:false,
dataType:'json',
type:'GET',
success:function (data) {
2014-01-28 02:58:39 -03:00
if (options.postUpdate) {
options.postUpdate(data)
2014-01-28 00:28:42 -03:00
}
},
error:function (jqXHR, textStatus, errorThrown) {
$('#messagesPanel div').text(errorThrown).parent().show();
}
});
}