Code Monkey home page Code Monkey logo

Comments (1)

AmoebeLabs avatar AmoebeLabs commented on August 10, 2024

Implementation notes

Tool

The current tool implementation looks like this. The event handler uses the card entities configuration to process and forward the click event

    return svg`
      <g id="line-${this.toolId}" class="${classMap(this.classes.tool)}" style="${styleMap(this.styles.tool)}"
        @click=${e => this._card.handleEvent(e, this._card.config.entities[this.config.entity_index])}>
        ${this._renderLine()}
      </g>
    `;

Currently, there is ALWAYS a click handler, as this one is added by default to process the "more-info" popup. This won't be the case anymore with the new tool-based click handlers.

So a click handler should be registered only if

  • a this.config.user_actions.tap_action is defined
  • the actions.action is either more-info or call-service AND an entity_index is defined
  • the actions.action is navigate

The slider-tool is a special one: that one should register its own handlers for click and drag!

EventHandler (Card)

The current eventhandler (card::handleEvent and card::_handleClick are both part of the card class, and should be moved to the baseTool class.

from swiss-army-knife-card.

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.