Improving the 3 apps
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
Sam Russell
|
||||
Captured Sun
|
||||
11.7.25 - changed registerShadow() to register(), changed onClick() to be like onHover()
|
||||
11.6.25 - adding default value for "button()" "children" parameter
|
||||
10.29.25 - adding "gap()" and "label()" functions
|
||||
*/
|
||||
@@ -186,7 +187,7 @@ window.Shadow = class extends HTMLElement {
|
||||
super()
|
||||
}
|
||||
}
|
||||
window.registerShadow = (el, tagname) => {
|
||||
window.register = (el, tagname) => {
|
||||
if (typeof el.prototype.render !== 'function') {
|
||||
throw new Error("Element must have a render: " + el.prototype.constructor.name)
|
||||
}
|
||||
@@ -713,7 +714,10 @@ HTMLElement.prototype.onAppear = function(func) {
|
||||
};
|
||||
|
||||
HTMLElement.prototype.onClick = function(func) {
|
||||
this._storeListener("click", func);
|
||||
const onMouseDown = () => func.call(this, true);
|
||||
const onMouseUp = () => func.call(this, false);
|
||||
this._storeListener("mousedown", onMouseDown);
|
||||
this._storeListener("mouseup", onMouseUp);
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user