JSFiddle - React, Tailwind, and code Playground

by enyojs

JavaScript

enyo.kind({
    name: "MySample",
    components: [
        {kind: "onyx.Button", content: "Allow Tap", ontap:"event1", ondragstart:"event1", ondragfinish:"event1"},
        {kind: "Scroller", style:"height:200px;", components: [
            {name: "console1", allowHtml:true},
        ]},
        {kind: "onyx.Button", content: "Prevent Tap", ontap:"event2", ondragstart:"event2", ondragfinish:"event2"},
        {kind: "Scroller", style:"height:200px;", components: [
            {name: "console2", allowHtml:true},
        ]}
    ],
    event1: function(inSender, inEvent) {
        this.$.console1.addContent(inEvent.type + "<br>");
    },
    event2: function(inSender, inEvent) {
        if (inEvent.type == "dragfinish" && inEvent.preventTap) {
            inEvent.preventTap();
        }
        this.$.console2.addContent(inEvent.type + "<br>");
    }
});

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