mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-09 00:43:23 +01:00
add tag on add label to mindmap action
This commit is contained in:
parent
148b56aecb
commit
2f4efde017
@ -18,38 +18,49 @@ $(function () {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$("#linkBtn").click(
|
$("#linkBtn").click( function () {
|
||||||
function () {
|
var labels;
|
||||||
fetchLabels({
|
fetchLabels({
|
||||||
postUpdate: function(data) {
|
postUpdate: function(data) {
|
||||||
var labelList = $("#labelId");
|
labels = data.labels;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
//clear dropdown...
|
if (labels) {
|
||||||
labelList.find("option").remove();
|
var labelList = $("#labelId");
|
||||||
|
|
||||||
if (data.labels.length == 0) {
|
//clear dropdown...
|
||||||
window.alert('no hay labels, como resolvemos esto?');
|
labelList.find("option").remove();
|
||||||
return;
|
|
||||||
}
|
|
||||||
//append items to dropdown
|
|
||||||
$.each(data.labels, function(index, value) {
|
|
||||||
labelList.append($('<option></option>').val(value.id).html(value.title));
|
|
||||||
});
|
|
||||||
|
|
||||||
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
|
if (labels.length == 0) {
|
||||||
|
window.alert('no hay labels, como resolvemos esto?');
|
||||||
$("#add-label-dialog-modal").dialogForm({
|
return;
|
||||||
type:'PUT',
|
}
|
||||||
url:"c/restful/labels/maps?ids=" + jQuery.makeArray(mapIds).join(','),
|
//append items to dropdown
|
||||||
postUpdate: function(data) {
|
$.each(labels, function(index, value) {
|
||||||
|
labelList.append($('<option></option>').val(value.id).html(value.title).attr('color', value.color));
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
|
||||||
|
|
||||||
|
$("#add-label-dialog-modal").dialogForm({
|
||||||
|
type:'PUT',
|
||||||
|
url:"c/restful/labels/maps?ids=" + jQuery.makeArray(mapIds).join(','),
|
||||||
|
postUpdate: function() {
|
||||||
|
//tag selected mindmaps...
|
||||||
|
var rows = $('#mindmapListTable').dataTableExt.getSelectedRows();
|
||||||
|
for (var i = 0; i < rows.length; i++) {
|
||||||
|
$(rows[i]).find('.mindmapName').append(
|
||||||
|
labelTagsAsHtml([{
|
||||||
|
title: $(':selected', labelList).text(),
|
||||||
|
color: $(':selected', labelList).attr('color')
|
||||||
|
}])
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
|
|
||||||
$("#duplicateBtn").click(function () {
|
$("#duplicateBtn").click(function () {
|
||||||
// Map to be cloned ...
|
// Map to be cloned ...
|
||||||
|
@ -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() + labelTagsAsHtml(obj.aData.labels) + '</a>';
|
return '<span class="icon-file icon-blue"></span>' + '<a class="mindmapName" 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