fix add label UI

This commit is contained in:
Ezequiel Bergamaschi 2014-02-05 21:44:30 -03:00 committed by Ezequiel Bergamaschi
parent 668506ceb8
commit efb7e0cc3b
2 changed files with 6 additions and 3 deletions

View File

@ -631,7 +631,7 @@ public class MindmapController extends BaseController {
} }
@RequestMapping(method = RequestMethod.POST, value = "/labels/maps", consumes = {"application/json"}) @RequestMapping(method = RequestMethod.POST, value = "/labels/maps", consumes = {"application/json"})
@ResponseStatus(value = HttpStatus.ACCEPTED) @ResponseStatus(value = HttpStatus.OK)
public void addLabel(@RequestBody RestLabel restLabel, @RequestParam(required = true) String ids) throws WiseMappingException { public void addLabel(@RequestBody RestLabel restLabel, @RequestParam(required = true) String ids) throws WiseMappingException {
int labelId = restLabel.getId(); int labelId = restLabel.getId();
for (String id : ids.split(",")) { for (String id : ids.split(",")) {

View File

@ -585,6 +585,9 @@ function prepareLabelList(labels) {
} }
function linkLabelToMindmap(mapIds, label) { function linkLabelToMindmap(mapIds, label) {
var onSuccess = function () {
tagMindmaps(label.id, label.title, label.color);
};
jQuery.ajax("c/restful/labels/maps?ids=" + jQuery.makeArray(mapIds).join(','), { jQuery.ajax("c/restful/labels/maps?ids=" + jQuery.makeArray(mapIds).join(','), {
type: 'POST', type: 'POST',
dataType: "json", dataType: "json",
@ -594,8 +597,8 @@ function linkLabelToMindmap(mapIds, label) {
title: label.title, title: label.title,
color: label.color color: label.color
}), }),
success: function () { statusCode: {
tagMindmaps(label.id, label.title, label.color); 200: onSuccess
} }
}); });
} }