Coder Social home page Coder Social logo

window.on('destroy', handler) about pebblejs HOT 4 OPEN

pebble avatar pebble commented on July 23, 2024
window.on('destroy', handler)

from pebblejs.

Comments (4)

Meiguro avatar Meiguro commented on July 23, 2024

Nice catch! For some reason the WindowStack receives the show and hide events but don't pass it further. I'll be sure to change that.

from pebblejs.

samuelmr avatar samuelmr commented on July 23, 2024

I suppose this works now. I'm closing the issue.

from pebblejs.

rajington avatar rajington commented on July 23, 2024

I'm not sure if it is working, at least not on CloudPebble. I tried to write the simplest application, a select triggers a window show that has a listener on it, unfortunately it never gets triggered. My code below:

var UI = require('ui');

var main = new UI.Card({
  title: 'click select and view the logs'
});

var wind = new UI.Window();
wind.on('show', function() {
  console.log('Window is shown!');
});

main.show();

main.on('click', 'select', function(e) {
  console.log('Window is selected!');
  wind.show();
});

results in the following code when I repeatedly show and hide the window.

[PHONE] pebble-app.js:?: Window is selected!
[PHONE] pebble-app.js:?: (+) [window 2] : [card 1],[window 2]
[PHONE] pebble-app.js:?: (-) [window 2] : [card 1]
[PHONE] pebble-app.js:?: Window is selected!
[PHONE] pebble-app.js:?: (+) [window 2] : [card 1],[window 2]
[PHONE] pebble-app.js:?: (-) [window 2] : [card 1]
[PHONE] pebble-app.js:?: Window is selected!
[PHONE] pebble-app.js:?: (+) [window 2] : [card 1],[window 2]

from pebblejs.

Meiguro avatar Meiguro commented on July 23, 2024

Right, it is not yet on CloudPebble. I will notify this ticket when it is.

from pebblejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.