Commit a4d37b16 authored by c24b's avatar c24b

M [TPL] editForm delete + pressK

parent 57159fba
...@@ -209,16 +209,18 @@ function deleteOne(url){ ...@@ -209,16 +209,18 @@ function deleteOne(url){
}, },
success: function(xhr) { success: function(xhr) {
console.log("SUCCESS!"); console.log("SUCCESS!");
msg = "Sucessfully deleted" //msg = "Sucessfully deleted"
addPageStatus("success", "#editForm", msg); //addPageStatus("success", "#editForm", msg);
window.location.reload()
}, },
error: function(xhr) { error: function(xhr) {
console.log("FAIL!"); console.log("FAIL!");
console.log(xhr.status); window.location.reload()
var status = xhr.status; //console.log(xhr.status);
var info = xhr["detail"]; //var status = xhr.status;
var msg = "ERROR deleting project"+ url //var info = xhr["detail"];
console.log(msg) //var msg = "ERROR deleting project"+ url
//console.log(msg)
//addPageStatus("info", msg); //addPageStatus("info", msg);
//window.location.reload(); //window.location.reload();
}, },
...@@ -289,7 +291,7 @@ $(document).on("click","#delete", function(){ ...@@ -289,7 +291,7 @@ $(document).on("click","#delete", function(){
selected.forEach(function(url) { selected.forEach(function(url) {
deleteOne(url); deleteOne(url);
}); });
window.location.reload(); //window.location.reload();
}); });
//EDIT MULTI //EDIT MULTI
...@@ -318,7 +320,7 @@ $(document).on("click","#recalculate", function(){ ...@@ -318,7 +320,7 @@ $(document).on("click","#recalculate", function(){
$(document).on("click", ".delete", function() { $(document).on("click", ".delete", function() {
var url = $( this ).data("url"); var url = $( this ).data("url");
deleteOne(url); deleteOne(url);
window.location.reload(); //window.location.reload();
}); });
//UNIQUE EDITION //UNIQUE EDITION
...@@ -328,6 +330,13 @@ $(document).on("click",".edit", function(){ ...@@ -328,6 +330,13 @@ $(document).on("click",".edit", function(){
console.log(id) console.log(id)
//newform.collapse("show"); //newform.collapse("show");
$('#editForm-'+id).collapse('toggle') $('#editForm-'+id).collapse('toggle')
$(document).bind('keypress', function(e) {
if(e.keyCode==13){
$('#edit-submit-'+id).trigger('click');
}
});
$("#edit-submit-"+id).on('click', function(){ $("#edit-submit-"+id).on('click', function(){
//alert(url) //alert(url)
...@@ -340,6 +349,7 @@ $(document).on("click",".edit", function(){ ...@@ -340,6 +349,7 @@ $(document).on("click",".edit", function(){
//alert("cancel") //alert("cancel")
$('input#name-'+id).val(""); $('input#name-'+id).val("");
resetStatusForm("#editForm-"+id); resetStatusForm("#editForm-"+id);
}); });
$("button").on("click", ".edit", function(){ $("button").on("click", ".edit", function(){
......
...@@ -169,6 +169,12 @@ ...@@ -169,6 +169,12 @@
<script type="text/javascript" src="{% static "lib/gargantext/garganrest_projects.js" %}"></script> <script type="text/javascript" src="{% static "lib/gargantext/garganrest_projects.js" %}"></script>
<script type="text/javascript"> <script type="text/javascript">
getProjects(); getProjects();
$(document).bind('keypress', function(e) {
if(e.keyCode==13){
$('#createProject').trigger('click');
}
});
$(document).on("click","#createProject", function(e){ $(document).on("click","#createProject", function(e){
//alert("clicked"); //alert("clicked");
// //
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment