-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
50 lines (48 loc) · 1.19 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* @file mofron-event-contextmenu/index.js
* @brief right click event for mofron
* ## event function parameter
* - component: event target component object
* - event: "mouseover" event object by addEventListener
* - mixed: user specified parameter
* @license MIT
*/
module.exports = class extends mofron.class.Event {
/**
* initialize event
*
* @param (mixed) short-form parameter
* key-value: event config
* @type private
*/
constructor (prm) {
try {
super();
this.modname('ContextMenu');
if (undefined !== prm) {
this.config(prm);
}
} catch (e) {
console.error(e.stack);
throw e;
}
}
contents (tgt_dom) {
try {
let evt_obj = this;
tgt_dom.getRawDom()['oncontextmenu'] = (ev) => {
try {
evt_obj.execListener(ev);
return false;
} catch (e) {
console.error(e.stack);
throw e;
}
};
} catch (e) {
console.error(e.stack);
throw e;
}
}
}
/* end of file */