Commit 535b8ed5bb25e623fb9fb1abf3191df0f562ff94
1 parent
52b3d64d
Exists in
master
and in
7 other branches
Inclusão de parâmetro para controlar o comportamento dos ícones da barra de botõ…
…es, permitindo o uso de efeitos de destaque diferentes
Showing
1 changed file
with
70 additions
and
13 deletions
Show diff stats
classesjs/classe_barradebotoes.js
... | ... | @@ -128,6 +128,28 @@ i3GEO.barraDeBotoes = { |
128 | 128 | */ |
129 | 129 | BOTAOPADRAO: "pan", |
130 | 130 | /* |
131 | + Propriedade: COMPORTAMENTO | |
132 | + | |
133 | + Define o comportamento dos botões quando é pressionado | |
134 | + | |
135 | + Tipo: | |
136 | + {String} | |
137 | + | |
138 | + Valores: | |
139 | + | |
140 | + "padrao" - comportamento padrão, com bordas da esquerda e inferiores ativadas | |
141 | + | |
142 | + "destacado" - destaca apenas o botão atualmente pressionado | |
143 | + | |
144 | + "vermelho" - destaca com fundo vermelho | |
145 | + | |
146 | + "laranja" - destaca com fundo laranja | |
147 | + | |
148 | + "cinza" - destaca com fundo cinza | |
149 | + | |
150 | + */ | |
151 | + COMPORTAMENTO: "laranja", | |
152 | + /* | |
131 | 153 | Variavel: BARRAS |
132 | 154 | |
133 | 155 | Array com os objetos YAHOO.janelaBotoes.xp.panel criados |
... | ... | @@ -157,12 +179,9 @@ i3GEO.barraDeBotoes = { |
157 | 179 | */ |
158 | 180 | ativaIcone: function(icone){ |
159 | 181 | i3GEO.barraDeBotoes.BOTAOCLICADO = icone; |
160 | - //desativa todos os ícones | |
161 | 182 | var ko = i3GEO.barraDeBotoes.LISTABOTOES.length-1; |
162 | - if(ko >= 0) | |
163 | - { | |
164 | - do | |
165 | - { | |
183 | + if(i3GEO.barraDeBotoes.COMPORTAMENTO == "padrao"){ | |
184 | + if(ko >= 0){do{ | |
166 | 185 | var temp = $i(i3GEO.barraDeBotoes.LISTABOTOES[ko].iddiv); |
167 | 186 | if (i3GEO.barraDeBotoes.LISTABOTOES[ko].tipo=="dinamico" && temp) |
168 | 187 | { |
... | ... | @@ -172,15 +191,53 @@ i3GEO.barraDeBotoes = { |
172 | 191 | ist.borderLeftColor='rgb(50,50,50)'; |
173 | 192 | ist.borderBottomColor='rgb(50,50,50)'; |
174 | 193 | } |
175 | - } | |
176 | - while(ko--) | |
194 | + }while(ko--)} | |
195 | + //ativa o icone | |
196 | + if($i(icone)) | |
197 | + {with ($i(icone).style){ | |
198 | + borderColor='white'; | |
199 | + borderWidth="1px"; | |
200 | + }} | |
201 | + } | |
202 | + if(i3GEO.barraDeBotoes.COMPORTAMENTO == "destacado"){ | |
203 | + if(ko >= 0){do{ | |
204 | + var temp = $i(i3GEO.barraDeBotoes.LISTABOTOES[ko].iddiv); | |
205 | + if (temp) | |
206 | + { | |
207 | + var ist = temp.style; | |
208 | + ist.borderWidth="1px"; | |
209 | + ist.borderColor='white'; | |
210 | + } | |
211 | + }while(ko--)} | |
212 | + //ativa o icone | |
213 | + if($i(icone)) | |
214 | + {with ($i(icone).style){ | |
215 | + borderColor='black'; | |
216 | + borderWidth="1px"; | |
217 | + }} | |
218 | + } | |
219 | + if(i3GEO.barraDeBotoes.COMPORTAMENTO == "laranja" || i3GEO.barraDeBotoes.COMPORTAMENTO == "vermelho" || i3GEO.barraDeBotoes.COMPORTAMENTO == "cinza"){ | |
220 | + if(ko >= 0){do{ | |
221 | + var temp = $i(i3GEO.barraDeBotoes.LISTABOTOES[ko].iddiv); | |
222 | + if (temp) | |
223 | + { | |
224 | + var ist = temp.style; | |
225 | + ist.borderWidth="1px"; | |
226 | + ist.borderColor='white'; | |
227 | + ist.backgroundColor='white'; | |
228 | + } | |
229 | + }while(ko--)} | |
230 | + if(i3GEO.barraDeBotoes.COMPORTAMENTO == "laranja"){var cor = "orange";} | |
231 | + if(i3GEO.barraDeBotoes.COMPORTAMENTO == "vermelho"){var cor = "red";} | |
232 | + if(i3GEO.barraDeBotoes.COMPORTAMENTO == "cinza"){var cor = "gray";} | |
233 | + //ativa o icone | |
234 | + if($i(icone)) | |
235 | + {with ($i(icone).style){ | |
236 | + borderColor='black'; | |
237 | + borderWidth="1px"; | |
238 | + backgroundColor=cor; | |
239 | + }} | |
177 | 240 | } |
178 | - //ativa o icone | |
179 | - if($i(icone)) | |
180 | - {with ($i(icone).style){ | |
181 | - borderColor='white'; | |
182 | - borderWidth="1px"; | |
183 | - }} | |
184 | 241 | }, |
185 | 242 | /* |
186 | 243 | Function: ativaBotoes | ... | ... |