JSFiddle - React, Tailwind, and code Playground
by enyojs
JavaScript
enyo.Control.extend({
previewDomEvent: enyo.inherit(function (sup) {
return function (inEvent) {
sup.apply(this, arguments);
if (this.preventTapOnDrag) {
if (inEvent.type == "drag") {
this._preventTap = true;
} else if (inEvent.type == "up") {
if (this._preventTap) {
this._preventTap = false;
inEvent.preventTap();
}
}
}
};
}),
});
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", name: "blue", preventTapOnDrag:true},
{name: "result"}
],
tapped: function(inSender, inEvent) {
this.$.result.setContent(enyo.now() + " " + inSender.name + " tapped");
}
});
new MySample({fit:true}).write();