Repository navigation
Conversation
Includes all 3 exercise subfolders and the menu.view demo referenced by the article's own iframe. No SVGs in this chapter. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
| - Pressionar o botão do mouse sobre um texto e movê-lo -- seleciona o texto. | ||
|
|
||
| If we handle an event in JavaScript, we may not want the corresponding browser action to happen, and want to implement another behavior instead. | ||
| Se tratarmos um evento em JavaScript, podemos não querer que a ação correspondente do navegador aconteça, e queremos implementar outro comportamento em vez disso. |
There was a problem hiding this comment.
Detalhe (opcional, não bloqueia): no original, o "may" vale para as duas partes da frase ("we may not want ... and want to implement another behavior instead"). Com "e queremos", a segunda parte vira uma afirmação e a frase perde um pouco o sentido de possibilidade. Que tal assim?
| Se tratarmos um evento em JavaScript, podemos não querer que a ação correspondente do navegador aconteça, e queremos implementar outro comportamento em vez disso. | |
| Se tratarmos um evento em JavaScript, podemos não querer que a ação correspondente do navegador aconteça e, em vez disso, querer implementar outro comportamento. |
| Por que isso pode ser necessário? | ||
|
|
||
| There are some events like `touchmove` on mobile devices (when the user moves their finger across the screen), that cause scrolling by default, but that scrolling can be prevented using `preventDefault()` in the handler. | ||
| Há alguns eventos como `touchmove` em dispositivos móveis (quando o usuário move o dedo pela tela), que causam rolagem por padrão, mas essa rolagem pode ser prevenida usando `preventDefault()` no manipulador. |
There was a problem hiding this comment.
Detalhe (opcional, não bloqueia): "A opção opcional" fica redundante em português. Uma sugestão para evitar a repetição:
| Há alguns eventos como `touchmove` em dispositivos móveis (quando o usuário move o dedo pela tela), que causam rolagem por padrão, mas essa rolagem pode ser prevenida usando `preventDefault()` no manipulador. | |
| A opção `passive: true` de `addEventListener`, que é opcional, sinaliza ao navegador que o manipulador não vai chamar `preventDefault()`. |
| @@ -1 +1 @@ | |||
| The solution is to assign the handler to the container and track clicks. If a click is on the `<a>` link, then change `src` of `#largeImg` to the `href` of the thumbnail. | |||
| A solução é atribuir o manipulador ao container e rastrear os cliques. Se um clique for no link `<a>`, então muda o `src` de `#largeImg` para o `href` da miniatura. | |||
There was a problem hiding this comment.
Detalhe (opcional, não bloqueia): o original dá uma instrução ("then change"), e "então muda" pode ser lido como "então [ele] muda". O imperativo "mude" deixa o sentido mais claro e combina com o tratamento usado no restante do tutorial:
| A solução é atribuir o manipulador ao container e rastrear os cliques. Se um clique for no link `<a>`, então muda o `src` de `#largeImg` para o `href` da miniatura. | |
| A solução é atribuir o manipulador ao container e rastrear os cliques. Se um clique for no link `<a>`, então mude o `src` de `#largeImg` para o `href` da miniatura. |
- Keep "may" applying to both halves of the sentence instead of turning the second clause into a flat statement - Avoid "opção opcional" redundancy - Use imperative "mude" to match the instruction in the original and the tutorial's established style Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Obrigado pela revisão, @gabifs! Corrigido:
|
Resumo
Traduz o artigo "Browser default actions" para o português, incluindo os 3 exercícios desta pasta e a demo
menu.viewreferenciada pelo próprio iframe do artigo. Não há SVGs neste capítulo.Conforme comentado na #1.
Plano de teste