|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('input.autodoc_home_modal_name').change(function(e) { |
|
|
$('input.autodoc_home_modal_name').change(function(e) { |
|
|
var docid = $('#autodoc_home_modal').data('documentid'); |
|
|
var docid = $('#autodoc_home_modal').data('documentid'); |
|
|
document_update_name(docid, $(e.target).val()), function() { |
|
|
|
|
|
home_modal_open(docid); |
|
|
|
|
|
$('span.autodoc_home_modal_name').removeClass('d-none'); |
|
|
|
|
|
$('input.autodoc_home_modal_name').addClass('d-none'); |
|
|
|
|
|
}}); |
|
|
|
|
|
|
|
|
document_update_name(docid, $(e.target).val(), docid); |
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
$(window).bind("hashchange", function () { |
|
|
$(window).bind("hashchange", function () { |
|
|
|
|
|
|
|
|
$('#autodoc_home_modal').modal('hide'); |
|
|
$('#autodoc_home_modal').modal('hide'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function document_update_name(docid, name, cb) { |
|
|
|
|
|
|
|
|
function document_update_name(docid, name) { |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
type: "PATCH", |
|
|
type: "PATCH", |
|
|
url: conf.openapi + "/documents/" + docid + "?name=" + encodeURIComponent(name), |
|
|
url: conf.openapi + "/documents/" + docid + "?name=" + encodeURIComponent(name), |
|
|
data: null, |
|
|
|
|
|
success: function(data) { cb(); }, |
|
|
|
|
|
|
|
|
success: function(data) { |
|
|
|
|
|
$('span.autodoc_home_modal_name').removeClass('d-none'); |
|
|
|
|
|
$('input.autodoc_home_modal_name').addClass('d-none'); |
|
|
|
|
|
home_modal_open(docid); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |