diff --git a/wise-webapp/src/main/resources/messages_en.properties b/wise-webapp/src/main/resources/messages_en.properties index 0fbf773f..68a7a81d 100644 --- a/wise-webapp/src/main/resources/messages_en.properties +++ b/wise-webapp/src/main/resources/messages_en.properties @@ -147,6 +147,7 @@ MIND_FILE=File PARENT_LABEL=Nest label under CHOOSE_COLOR=Choose a color CHOOSE_LABEL=Choose a label +CREATE_NEW_LABEL=Create a new label.. SELECT_LABEL=Please select a label NO_SEARCH_RESULT=No mindmap available for the selected filter criteria SEARCH=Search diff --git a/wise-webapp/src/main/webapp/js/buttonActions.js b/wise-webapp/src/main/webapp/js/buttonActions.js index 5c2401a1..03186a34 100644 --- a/wise-webapp/src/main/webapp/js/buttonActions.js +++ b/wise-webapp/src/main/webapp/js/buttonActions.js @@ -1,6 +1,6 @@ $(function () { // Creation buttons actions ... - $("#newMapBtn").click( + $("#newBtn").click( function () { $("#new-dialog-modal").dialogForm({ redirect:"c/maps/{header.resourceId}/edit", @@ -9,7 +9,7 @@ $(function () { } ); - $("#newFolderBtn").click( + $(document).on('click', '#createLabelBtn', function () { $("#new-folder-dialog-modal").dialogForm({ url:"c/restful/labels", @@ -18,7 +18,7 @@ $(function () { } ); - $("#linkBtn").click( function () { + $("#addLabelButton").click( function () { var labels; fetchLabels({ postUpdate: function(data) { @@ -27,20 +27,26 @@ $(function () { }); if (labels) { - var labelList = $("#labelId"); + var labelList = $("#labelList"); + var defaultValue = labelList.find("li[id=\"createLabelBtn\"]"); //clear dropdown... - labelList.find("option").remove(); - - if (labels.length == 0) { - window.alert('no hay labels, como resolvemos esto?'); - return; - } + labelList.find('li').remove(); //append items to dropdown $.each(labels, function(index, value) { - labelList.append($('').val(value.id).html(value.title).attr('color', value.color)); + labelList.append( + $('
') + .append('' + + '' + + ''+ value.title + + '' + + '')); }); + //add the defaultValue + labelList.append('