mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 14:17:57 +01:00
insert tag on table load
This commit is contained in:
parent
eff063ca37
commit
ed55fd824f
@ -1,7 +1,4 @@
|
|||||||
function createLabelItem(data) {
|
function createLabelItem(data) {
|
||||||
if (data.color == "") {
|
|
||||||
data.color = "#000000";
|
|
||||||
}
|
|
||||||
$("#foldersContainer").find("ul").append(
|
$("#foldersContainer").find("ul").append(
|
||||||
$("<li data-filter=\"" + data.title + "\">").append(
|
$("<li data-filter=\"" + data.title + "\">").append(
|
||||||
"<a href=\"#\"> <i class=\"icon-tag\"></i>" +
|
"<a href=\"#\"> <i class=\"icon-tag\"></i>" +
|
||||||
@ -10,7 +7,15 @@ function createLabelItem(data) {
|
|||||||
"</a>"
|
"</a>"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function labelTagsAsHtml(labels) {
|
||||||
|
var result = "";
|
||||||
|
for (var i = 0; i<labels.length; i++) {
|
||||||
|
var label = labels[i];
|
||||||
|
result+= "<div class='labelTag' style='background-color:" + label.color + "'>"+ label.title + "</div>"
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchLabels(options) {
|
function fetchLabels(options) {
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
bUseRendered:false,
|
bUseRendered:false,
|
||||||
mDataProp:"title",
|
mDataProp:"title",
|
||||||
fnRender:function (obj) {
|
fnRender:function (obj) {
|
||||||
return '<span class="icon-file icon-blue"></span>' + '<a href="c/maps/' + obj.aData.id + '/edit">' + $('<span></span>').text(obj.aData.title).html() + '</a>';
|
return '<span class="icon-file icon-blue"></span>' + '<a href="c/maps/' + obj.aData.id + '/edit">' + $('<span></span>').text(obj.aData.title).html() + labelTagsAsHtml(obj.aData.labels) + '</a>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user