mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-09-11 23:00:06 +02:00
add label to mindmap ui logic
This commit is contained in:
parent
ed55fd824f
commit
9edea47dbd
@ -22,15 +22,32 @@ $(function () {
|
||||
function () {
|
||||
fetchLabels({
|
||||
postUpdate: function(data) {
|
||||
var labelList = $("#labelId");
|
||||
|
||||
//clear dropdown...
|
||||
labelList.find("option").remove();
|
||||
|
||||
if (data.labels.length == 0) {
|
||||
window.alert('no hay labels, como resolvemos esto?');
|
||||
return;
|
||||
}
|
||||
//append items to dropdown
|
||||
$.each(data.labels, function(index, value) {
|
||||
$("#labelList").append($('<option></option>').val(index).html(value.title));
|
||||
})
|
||||
labelList.append($('<option></option>').val(value.id).html(value.title));
|
||||
});
|
||||
|
||||
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
|
||||
|
||||
$("#add-label-dialog-modal").dialogForm({
|
||||
type:'PUT',
|
||||
url:"c/restful/labels/maps?ids=" + jQuery.makeArray(mapIds).join(','),
|
||||
postUpdate: function(data) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$("#add-label-dialog-modal").dialogForm({
|
||||
//url:"c/restful/labels",
|
||||
//postUpdate: createLabelItem
|
||||
});
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -98,6 +98,14 @@ jQuery.fn.dialogForm = function (options) {
|
||||
$('#' + containerId + ' input').each(function (index, elem) {
|
||||
formData[elem.name] = elem.value;
|
||||
});
|
||||
|
||||
//No me gusta, revisar only support one select in the form
|
||||
var dropdown = $('#' + containerId + ' option:selected');
|
||||
if (dropdown.val()) {
|
||||
formData['id'] = dropdown.val();
|
||||
formData['title'] = dropdown.html();
|
||||
}
|
||||
|
||||
$(acceptBtn).button('loading');
|
||||
var dialogElem = this;
|
||||
jQuery.ajax(url, {
|
||||
|
Loading…
Reference in New Issue
Block a user