Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Converted pt-BR/docs/web/api/batterymanager/dischargingtimecha… #7243

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: BatteryManager.ondischargingtimechange
slug: Web/API/BatteryManager/dischargingtimechange_event
tags:
- API
- Battery API
- Event Handler
- Propriedade
- Referencia
translation_of: Web/API/BatteryManager/ondischargingtimechange
original_slug: Web/API/BatteryManager/ondischargingtimechange
Comment on lines +2 to +11
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: BatteryManager.ondischargingtimechange
slug: Web/API/BatteryManager/dischargingtimechange_event
tags:
- API
- Battery API
- Event Handler
- Propriedade
- Referencia
translation_of: Web/API/BatteryManager/ondischargingtimechange
original_slug: Web/API/BatteryManager/ondischargingtimechange
title: 'BatteryManager: dischargingtimechange event'
slug: Web/API/BatteryManager/dischargingtimechange_event
page-type: web-api-event
tags:
- API
- Event
- Reference
browser-compat: api.BatteryManager.dischargingtimechange_event
translation_of: Web/API/BatteryManager/ondischargingtimechange

---

{{APIRef("Battery API")}}

Especifica um _event listener_ para receber eventos {{event("dischargingtimechange")}}. Esses eventos ocorrem quando a propriedade {{domxref("BatteryManager.dischargingTime","dischargingTime")}} (tempo de descarregamento) da bateria é atualizada.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Especifica um _event listener_ para receber eventos {{event("dischargingtimechange")}}. Esses eventos ocorrem quando a propriedade {{domxref("BatteryManager.dischargingTime","dischargingTime")}} (tempo de descarregamento) da bateria é atualizada.
O evento **`dischargingtimechange`** da [API de status da bateria](/pt-BR/docs/Web/API/Battery_Status_API) é acionado quando a bateria {{domxref("BatteryManager.dischargingTime","dischargingTime")} } é atualizada.


## Sintaxe

navigator.battery.ondischargingtimechange = funcRef

Onde `funcRef` é uma função para ser chamada quando o evento {{event("dischargingtimechange")}} ocorre.
Comment on lines +18 to +22
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essa parte aqui eu não consigo adicionar a sugestão como as demais porque a formatação da página se confunde com o código..

## Sintaxe

Use o nome do evento em métodos como {{domxref("EventTarget.addEventListener", "addEventListener()")}} ou defina uma propriedade do manipulador de eventos.

```js
addEventListener('dischargingtimechange', (event) => { });

ondischargingtimechange = (event) => { };
```

## Tipo de evento

_Um {{domxref("Evento")}} genérico._

## Exemplo

### Conteúdo HTML

```html
(nível de bateria desconhecido)
(tempo de carregamento desconhecido)
``` ### Conteúdo JavaScript ```js navigator.getBattery().then((battery) => { battery.ondischargingtimechange = () => { document.querySelector('#level').textContent = battery.level; document.querySelector('#chargingTime').textContent = battery.chargingTime; } }); ``` {{ EmbedLiveSample('Example', '100%', 40) }}


## Especificações

{{Specifications}}

## Compatibilidade com navegadores

{{Compat}}

## Veja também

- {{domxref("BatteryManager")}}
- {{domxref("Navigator.battery")}}
Comment on lines +32 to +35
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Veja também
- {{domxref("BatteryManager")}}
- {{domxref("Navigator.battery")}}
## Veja também
- {{domxref("BatteryManager")}}
- {{domxref("Navigator.getBattery")}}