Commit 2b5ca3e7ec46fea813aadc25d0dd1192f291dcff
1 parent
2f73d993
Exists in
master
and in
7 other branches
--no commit message
Showing
2 changed files
with
26 additions
and
19 deletions
Show diff stats
admin/js/arvore.js
| ... | ... | @@ -814,6 +814,12 @@ function gravaDados(tipo,id) |
| 814 | 814 | { |
| 815 | 815 | success:function(o) |
| 816 | 816 | { |
| 817 | + var novo = "", | |
| 818 | + texto = "", | |
| 819 | + objpub, | |
| 820 | + publicado, | |
| 821 | + no, | |
| 822 | + obje; | |
| 817 | 823 | try |
| 818 | 824 | { |
| 819 | 825 | if(YAHOO.lang.JSON.parse(o.responseText) == "erro") |
| ... | ... | @@ -825,17 +831,17 @@ function gravaDados(tipo,id) |
| 825 | 831 | { |
| 826 | 832 | if(tipo == "grupo"){ |
| 827 | 833 | //verifica se o usuario escolheu um grupo ou digitou o nome de um novo |
| 828 | - var novo = document.getElementById("EnomeNovoGrupo"); | |
| 834 | + novo = document.getElementById("EnomeNovoGrupo"), | |
| 835 | + objpub = document.getElementById("Epublicado"), | |
| 836 | + publicado = objpub.options[objpub.selectedIndex].value; | |
| 829 | 837 | if(novo.value != ""){ |
| 830 | - var texto = novo.value; | |
| 838 | + texto = novo.value; | |
| 831 | 839 | } |
| 832 | 840 | else{ |
| 833 | - var texto = document.getElementById("Eid_grupo"); | |
| 841 | + texto = document.getElementById("Eid_grupo"); | |
| 834 | 842 | texto = texto.options[texto.selectedIndex].text; |
| 835 | 843 | } |
| 836 | - var objpub = document.getElementById("Epublicado"); | |
| 837 | - var publicado = objpub.options[objpub.selectedIndex].value; | |
| 838 | - var no = tree.getNodeByProperty("id_n1",id); | |
| 844 | + no = tree.getNodeByProperty("id_n1",id); | |
| 839 | 845 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto; |
| 840 | 846 | |
| 841 | 847 | if(publicado == "NAO") |
| ... | ... | @@ -848,18 +854,18 @@ function gravaDados(tipo,id) |
| 848 | 854 | if(tipo == "subgrupo") |
| 849 | 855 | { |
| 850 | 856 | //verifica se o usuario escolheu um subgrupo ou digitou o nome de um novo |
| 851 | - var novo = document.getElementById("EnomeNovoSubGrupo"); | |
| 857 | + novo = document.getElementById("EnomeNovoSubGrupo"); | |
| 852 | 858 | if(novo.value != ""){ |
| 853 | - var texto = novo.value; | |
| 859 | + texto = novo.value; | |
| 854 | 860 | } |
| 855 | 861 | else{ |
| 856 | - var texto = document.getElementById("Eid_subgrupo"); | |
| 862 | + texto = document.getElementById("Eid_subgrupo"); | |
| 857 | 863 | texto = texto.options[texto.selectedIndex].text; |
| 858 | 864 | } |
| 859 | - var objpub = document.getElementById("Epublicado"); | |
| 860 | - var publicado = objpub.options[objpub.selectedIndex].value; | |
| 865 | + objpub = document.getElementById("Epublicado"); | |
| 866 | + publicado = objpub.options[objpub.selectedIndex].value; | |
| 861 | 867 | |
| 862 | - var no = tree.getNodeByProperty("id_n2",id); | |
| 868 | + no = tree.getNodeByProperty("id_n2",id); | |
| 863 | 869 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto; |
| 864 | 870 | |
| 865 | 871 | if(publicado == "NAO") |
| ... | ... | @@ -871,13 +877,13 @@ function gravaDados(tipo,id) |
| 871 | 877 | } |
| 872 | 878 | if(tipo == "tema") |
| 873 | 879 | { |
| 874 | - var texto = document.getElementById("Eid_tema"); | |
| 880 | + texto = document.getElementById("Eid_tema"); | |
| 875 | 881 | texto = texto.options[texto.selectedIndex].text; |
| 876 | 882 | |
| 877 | - var objpub = document.getElementById("Epublicado"); | |
| 878 | - var publicado = objpub.options[objpub.selectedIndex].value; | |
| 883 | + objpub = document.getElementById("Epublicado"); | |
| 884 | + publicado = objpub.options[objpub.selectedIndex].value; | |
| 879 | 885 | |
| 880 | - var no = tree.getNodeByProperty("id_n3",id); | |
| 886 | + no = tree.getNodeByProperty("id_n3",id); | |
| 881 | 887 | |
| 882 | 888 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto; |
| 883 | 889 | |
| ... | ... | @@ -890,10 +896,10 @@ function gravaDados(tipo,id) |
| 890 | 896 | } |
| 891 | 897 | if(tipo == "raizmenu" || tipo == "raizgrupo") |
| 892 | 898 | { |
| 893 | - var obje = document.getElementById("Eid_tema"); | |
| 899 | + obje = document.getElementById("Eid_tema"); | |
| 894 | 900 | if(obje){ |
| 895 | - var texto = obje.options[obje.selectedIndex].text; | |
| 896 | - var no = tree.getNodeByProperty("id_raiz",id); | |
| 901 | + texto = obje.options[obje.selectedIndex].text; | |
| 902 | + no = tree.getNodeByProperty("id_raiz",id); | |
| 897 | 903 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto; |
| 898 | 904 | no.html = no.getContentEl().innerHTML; |
| 899 | 905 | } | ... | ... |