Giter VIP home page Giter VIP logo

Comments (11)

timvdalen avatar timvdalen commented on July 27, 2024 1

I guessed that, yes, but I still think there is some value in documenting that x-menuitem dispatches click events so you know that's the thing you should listen on.

I agree that this doesn't make sense for everything; x-label and x-card don't need click events.
However, for elements that revolve around a certain (standard) event, I think it makes sense to make that clear in the documentation.

from xel.

jarek-foksa avatar jarek-foksa commented on July 27, 2024

I'm planning to implement ./project update-docs script which should parse each x-*.js file and update corresponding HTML file with documentation. All required annotations (like @type, @Attribute or @events) are already in place.

from xel.

timvdalen avatar timvdalen commented on July 27, 2024

Sounds like a good plan, although I'm not sure the @events annotations are currently complete.
Looking at x-button, https://github.com/jarek-foksa/xel/blob/144043f/elements/x-button.js#L28-L29, only toggle is documented, while the documentation examples use click (as you would expect).

x-menuitem documents no events at all, while listing for click on them works.

from xel.

jarek-foksa avatar jarek-foksa commented on July 27, 2024

Note that x-button (XButtonElement) and x-menuitem (XMenuItemElement) are inheriting from the standard HTMLElement, which in turn dispatches the click event.

It doesn't make sense to document all the standard DOM events like click, dbclick, contextmenu, pointerdown, pointermove, pointerup, lostpointercapture, etc.

from xel.

tosolini avatar tosolini commented on July 27, 2024

i'm looking at the tabs, dont worry, but documentation seems incomplete. How content of each tabs is supposed to works?

from xel.

jarek-foksa avatar jarek-foksa commented on July 27, 2024

@tosolini You should listen for "open", "close" and "select" events on <x-doctabs>. When the event fires, you are responsible for updating manually the visibility of your views to match the current state of <x-doctabs>.

from xel.

tosolini avatar tosolini commented on July 27, 2024

@jarek-foksa thanks but this was clear. I dont understand the correlation between button tab and tab content, usually a typical tab have button with id and related content near or other part of page with same id in the container. In tabs examples i dont see the content at all. For example the x-accordion is clear to understand.

from xel.

jarek-foksa avatar jarek-foksa commented on July 27, 2024

<x-tabs> and <x-doctabs> widgets are responsible only for drawing the tabs, If you want a given tab to toggle some specific content with given ID, you should implement this behavior yourself.

This functionality is not provided out of the box because some apps might want to load the content associated with the tab asynchronously or perform other optimisations such as disconnecting the content from the DOM tree when it is not toggled.

from xel.

tosolini avatar tosolini commented on July 27, 2024

ok understood.

from xel.

jarek-foksa avatar jarek-foksa commented on July 27, 2024

The new project website now documents the JavaScript API for each element.

from xel.

timvdalen avatar timvdalen commented on July 27, 2024

Nice!

from xel.

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.