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,6 +814,12 @@ function gravaDados(tipo,id) | ||
| 814 | { | 814 | { |
| 815 | success:function(o) | 815 | success:function(o) |
| 816 | { | 816 | { |
| 817 | + var novo = "", | ||
| 818 | + texto = "", | ||
| 819 | + objpub, | ||
| 820 | + publicado, | ||
| 821 | + no, | ||
| 822 | + obje; | ||
| 817 | try | 823 | try |
| 818 | { | 824 | { |
| 819 | if(YAHOO.lang.JSON.parse(o.responseText) == "erro") | 825 | if(YAHOO.lang.JSON.parse(o.responseText) == "erro") |
| @@ -825,17 +831,17 @@ function gravaDados(tipo,id) | @@ -825,17 +831,17 @@ function gravaDados(tipo,id) | ||
| 825 | { | 831 | { |
| 826 | if(tipo == "grupo"){ | 832 | if(tipo == "grupo"){ |
| 827 | //verifica se o usuario escolheu um grupo ou digitou o nome de um novo | 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 | if(novo.value != ""){ | 837 | if(novo.value != ""){ |
| 830 | - var texto = novo.value; | 838 | + texto = novo.value; |
| 831 | } | 839 | } |
| 832 | else{ | 840 | else{ |
| 833 | - var texto = document.getElementById("Eid_grupo"); | 841 | + texto = document.getElementById("Eid_grupo"); |
| 834 | texto = texto.options[texto.selectedIndex].text; | 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 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto; | 845 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto; |
| 840 | 846 | ||
| 841 | if(publicado == "NAO") | 847 | if(publicado == "NAO") |
| @@ -848,18 +854,18 @@ function gravaDados(tipo,id) | @@ -848,18 +854,18 @@ function gravaDados(tipo,id) | ||
| 848 | if(tipo == "subgrupo") | 854 | if(tipo == "subgrupo") |
| 849 | { | 855 | { |
| 850 | //verifica se o usuario escolheu um subgrupo ou digitou o nome de um novo | 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 | if(novo.value != ""){ | 858 | if(novo.value != ""){ |
| 853 | - var texto = novo.value; | 859 | + texto = novo.value; |
| 854 | } | 860 | } |
| 855 | else{ | 861 | else{ |
| 856 | - var texto = document.getElementById("Eid_subgrupo"); | 862 | + texto = document.getElementById("Eid_subgrupo"); |
| 857 | texto = texto.options[texto.selectedIndex].text; | 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 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto; | 869 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto; |
| 864 | 870 | ||
| 865 | if(publicado == "NAO") | 871 | if(publicado == "NAO") |
| @@ -871,13 +877,13 @@ function gravaDados(tipo,id) | @@ -871,13 +877,13 @@ function gravaDados(tipo,id) | ||
| 871 | } | 877 | } |
| 872 | if(tipo == "tema") | 878 | if(tipo == "tema") |
| 873 | { | 879 | { |
| 874 | - var texto = document.getElementById("Eid_tema"); | 880 | + texto = document.getElementById("Eid_tema"); |
| 875 | texto = texto.options[texto.selectedIndex].text; | 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 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto; | 888 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto; |
| 883 | 889 | ||
| @@ -890,10 +896,10 @@ function gravaDados(tipo,id) | @@ -890,10 +896,10 @@ function gravaDados(tipo,id) | ||
| 890 | } | 896 | } |
| 891 | if(tipo == "raizmenu" || tipo == "raizgrupo") | 897 | if(tipo == "raizmenu" || tipo == "raizgrupo") |
| 892 | { | 898 | { |
| 893 | - var obje = document.getElementById("Eid_tema"); | 899 | + obje = document.getElementById("Eid_tema"); |
| 894 | if(obje){ | 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 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto; | 903 | no.getContentEl().getElementsByTagName("span")[0].innerHTML = texto; |
| 898 | no.html = no.getContentEl().innerHTML; | 904 | no.html = no.getContentEl().innerHTML; |
| 899 | } | 905 | } |