UNPKG

@sutton-signwriting/sgnw-components

Version:

a javascript package of web components for use with the SignWriting script.

59 lines (58 loc) 1.98 kB
/*! * The Sutton SignWriting Web Components */ // import { Host, h } from "@stencil/core"; import { overlap } from "../../global/global"; export class SgnwSignbox { paletteSymbolDropHandler(event) { const target = event.target; if (overlap(target, this.el)) { console.log(event.detail); } } render() { return (h(Host, { key: '25417291dbf92652efeeb276d84966614e555eb9' }, h("slot", { key: '2a39fc75573ba0c826909434dac433869bea9a1a' }))); } static get is() { return "sgnw-signbox"; } static get encapsulation() { return "scoped"; } static get originalStyleUrls() { return { "$": ["sgnw-signbox.css"] }; } static get styleUrls() { return { "$": ["sgnw-signbox.css"] }; } static get elementRef() { return "el"; } static get listeners() { return [{ "name": "paletteSymbolDrop", "method": "paletteSymbolDropHandler", "target": "window", "capture": false, "passive": false }]; } } // // window.addEventListener('fancyEvent', function(e) {}) // // var adj = DictionaryFront.signmaker.size/2; // var sb = document.getElementById("signbox"); // if (overlap(this.element,sb)){ // var offset1 = getOffset( this.element ), // offset2 = getOffset( sb ); // var symbol = {symbol:this.element.symbol,x: parseInt(500-adj+offset1.left-offset2.left),y: parseInt(500-adj-1+offset1.top-offset2.top)}; // DictionaryFront.signbox.addSymbol(symbol); // } else { // var seq = document.getElementById("sequence"); // if (overlap(this.element,seq)){ // var offset1 = getOffset( this.element ), // offset2 = getOffset( seq ); // var symbol = {symbol:this.element.symbol}; // DictionaryFront.sequence.addSymbol(symbol,parseInt((offset1.top-offset2.top)/28)); // } // }