btn actions

This commit is contained in:
Ezequiel Bergamaschi 2014-02-01 14:06:41 -03:00 committed by Ezequiel Bergamaschi
parent 0eaa8c8638
commit 8936ef5008
2 changed files with 18 additions and 11 deletions

View File

@ -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

View File

@ -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($('<option></option>').val(value.id).html(value.title).attr('color', value.color));
labelList.append(
$('<li></li>')
.append('<a href="#" onclick="return false">' +
'<i class="icon-tag"></i>' +
'<span style="margin-left: 5px">'+ value.title +
'</span>' +
'</a>'));
});
//add the defaultValue
labelList.append('<li><div style="height: 1px; background-color: #d5d3d4"></div></li>')
labelList.append(defaultValue);
var mapIds = $('#mindmapListTable').dataTableExt.getSelectedMapsIds();
$("#add-label-dialog-modal").dialogForm({