Commit 27d86c3f authored by c24b's avatar c24b

WIP help

parent 7eb21ee2
......@@ -183,35 +183,57 @@
<script type="text/javascript" src="{% static "lib/gargantext/garganrest_projects.js" %}"></script>
<script type="text/javascript">
help = {"#add":
{"title": "Ajouter un projet",
help = {"#add":{
"title": "Ajouter un projet",
"content":"Clickez sur le bouton pour créer un nouveau projet",
"placement":"bottom"
"placement":"bottom",
},
"#test":{
"title": "This is a title",
"content": "This is a content",
"placement": "top",
},
}
$( ".help" ).each(function(el) {
console.log(el)
id = $(this).attr["id"]
$( ".help" ).each(function(i, el) {
id = el.id
div_id = "#"+id
console.log(div_id)
btn = id+"-help"
help_button = '<span role="button" class="glyphicon glyphicon-question-sign" id="'+btn+'"></span>'
//info = help['#'+$(this).attr["id"]];
//console.log(info["title"]);
next_el = $(this).after(help_button);
$('span'+'#'+btn).popover({
html:true,
title : help['#'+$(this).attr["id"]]["title"],
content: '<p class="text-center">'+help['#'+$(this).attr["id"]]["content"]+'</p>',
container: 'body',
trigger:"focus",
placement: help['#'+$(this).attr["id"]]["title"]["placement"],
});
$('span'+'#'+btn).popover("toogle")
info = help[div_id]
console.log(info)
help_icon = '<span type="button" id="'+btn+'"role="button" onclick="get_help();" class="glyphicon glyphicon-question-sign"></span>'
// help_button = '<button '+
// 'data-toogle="popover"'+
// 'data-placement="'+ info["placement"]+'"'+
// 'title="'+ info["title"]+'"'+
// 'data-content="'+ info["content"]+'"'+
// 'data-container="body"'+
// 'data-trigger="click"'+
// 'id="'+btn+'"><span class="glyphicon glyphicon-question-sign"></span></button>'
$(this).after(help_icon);
})
function get_help(){
console.log($(this.attr('id'));
};
// console.log($("#"+btn))
// pop = $("#"+btn)
// $(pop).popover({
// html:true,
// title : info["title"],
// content: '<p class="text-center">'+info["content"]+'</p>',
// container: 'body',
// trigger:"focus",
// placement: info["title"]["placement"],
// });
// $('#'+btn).popover("toogle");
// $(next_el).on("click", function(e){
// next_el
// })
});
// });
getProjects();
// $(document).on("input#inoutName").bind('keypress', function(e) {
// if(e.keyCode==13){
......
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