Git Product home page Git Product logo

Comments (4)

vitmalina avatar vitmalina commented on August 16, 2024

All event handlers are called before any changes applied to the object. It is done this way to allow events to be cancelable. However, if you need to execute a function after changes applied to the object you can do it this way:

w2ui['layout'].on('resize', function(target, data) {
    data.onComplete = function () {
        var width = w2ui['layout'].get('main').width;
        var height = w2ui['layout'].get('main').height;
        console.log(width + 'x' + height);
    }
});

You can read more about event flow here: http://w2ui.com/web/docs/utils/events

from w2ui.

vitmalina avatar vitmalina commented on August 16, 2024

You can attach event listeners to the panels, but there is no onResize for the panel, only entire layout. I have noticed, when layout is resized, main panel always resized and possibly some other panel (if it was not window resize). I have added data.panel variable to indicate what panel in addition to main was resized. Just checked into current working version.

from w2ui.

matthjes avatar matthjes commented on August 16, 2024

Thanks for you help! it's working now. It's not a continuous update, but it still sets the values after the resize operation has finished.

from w2ui.

matthjes avatar matthjes commented on August 16, 2024

Ok, as I don't use facebook, here is my comment: Great library, just what I was looking for: small, fast, easy to use, with a good set of widgets, a great layout system and MIT license. Was kind of hard to find, though, well, it's also very new. Keep up the good work!!

from w2ui.

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.