js refactor
This commit is contained in:
committed by
Ezequiel Bergamaschi
parent
c7b193f43f
commit
acb3782561
24
wise-webapp/src/main/webapp/js/labelActions.js
Normal file
24
wise-webapp/src/main/webapp/js/labelActions.js
Normal file
@@ -0,0 +1,24 @@
|
||||
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user