JSFiddle - React, Tailwind, and code Playground

by enyojs

JavaScript

enyo.kind({
    name: "MySample",
    classes: "enyo-unselectable",
    components: [
        {style:"background:red; border-radius:10px; margin:10px; padding:40px; display:inline-block; color: white;", content:"Drag inside", ontap:"tapped", name:"red"},
        {style:"background:blue; border-radius:10px; margin:10px; padding:40px; display:inline-block; color: white;", content:"Drag inside", ontap:"tapped", ondrag:"drag", onup:"up", name: "blue"},
        {name: "result"}
    ],
    drag: function() {
        this.preventTap = true;
    },
    up: function(inSender, inEvent) {
        if (this.preventTap) {
            this.preventTap = false;
            inEvent.preventTap();
        }
    },
    tapped: function(inSender, inEvent) {
        this.$.result.setContent(enyo.now() + " " + inSender.name + " tapped");
    }
});

new MySample({fit:true}).write();