/* class2context.js creator: Arnau July 2016 version: v0.1 usage: class2context( 'className', "title", [["option1", "functionoption1()"], ["option 2","functionoption2()"]] ); */ //if the div 'contextMenus' exist, deletes if(document.getElementById('contextMenus')) { removeElemById('contextMenus'); } //creates the div where the context menus will place document.body.innerHTML+="
"; // function removeElemById(id) { return (elem=document.getElementById(id)).parentNode.removeChild(elem); } function class2context(classgiv, title, options){ classgiv=JSON.parse(JSON.stringify(classgiv)); if(document.getElementById("context"+classgiv)) { //toastr.success("alreadyExist"); }else{ var aux=""; aux+="
"; aux+=" "; aux+="
"; document.getElementById('contextMenus').innerHTML+=aux; //adds the div context menu into the context menus div place } for(var i=0; i