Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  tooltip.js   Sprache: JAVA

 
import {Decorators} from '../decorator/factory';
import Renderer from './renderer';

/**
 * Implements a Tooltip.
 *
 * This component creates a tooltip containing a set of messages.
 *
 * @extends {Renderer}
 */

export default class Tooltip extends Renderer {

  /**
   * Base constructor
   *
   * @typedef {Object} options
   * @property {String} options.appendTo - where the generated html/svg components will be attached to, default body
   * @property {Function} options.callbackHandler - this handler will be used to invoke actions from the menu, default console.log
   * @property {Object} context - the context of the application, usually a configuration and a rendering manager instance
   */

  constructor({appendTo, callbackHandler}, context) {
    super({appendTo: appendTo, callbackHandler: callbackHandler}, context);
  }

  /**
   * This method is used to render this component
   *
   * @public
   */

  @Decorators.Data.requires('messages')
  async render(e) {

    this.element = this.HTMLParent.select('div.francy-tooltip-holder');
    // check if the window is already present
    if (!this.element.node()) {
      this.element = this.HTMLParent.append('div')
        .attr('class''francy-tooltip-holder');
    }

    // check if it exists already
    if (this.element.selectAll('*').node()) return;

    let position = this.getMousePosition(e);

    // TODO this won't be visible all the times, fine until someone complains about :P
    this.element.style('left', (position[0] + 15) + 'px').style('top', (position[1] - 15) + 'px');

    let table = this.element.append('div').attr('class''francy-tooltip')
      .append('div').attr('class''francy-table')
      .append('div').attr('class''francy-table-body');

    Object.keys(this.data.messages).map((key) => {
      let row = table.append('div').attr('class''francy-table-row');
      row.append('div').attr('class''francy-table-cell').text(this.data.messages[key].title);
      row.append('div').attr('class''francy-table-cell').text(this.data.messages[key].text);
    });

    // show tooltip
    this.element.style('display''block');

    // render mathTypesetting
    this.handlePromise(this.mathTypesetting(this.element.node()));

    // destroy me after default delay
    this.autoUnrender();

    return this;
  }

  /**
   * This method is used to destroy this component
   *
   * @public
   */

  unrender() {
    if (this.element) {
      this.element.selectAll('*').remove();
      this.element.style('display'null);
    }
  }
}

Messung V0.5
C=91 H=91 G=90

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge