mirror of
https://github.com/salexdv/bsl_console.git
synced 2025-02-15 13:53:04 +02:00
Изменение механизма создания событий.
Вместо программного клика на скрытой кнопки создается событие и вызывается dispatchEvent
This commit is contained in:
parent
7f1c39262f
commit
6619e13463
@ -1,17 +1,13 @@
|
||||
define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/editor.main', 'actions'], function () {
|
||||
|
||||
selectionText = '';
|
||||
lastEvent = {};
|
||||
|
||||
getEvent = function() {
|
||||
let e = lastEvent;
|
||||
lastEvent = {};
|
||||
return e;
|
||||
}
|
||||
selectionText = '';
|
||||
|
||||
sendEvent = function(eventName, eventParams) {
|
||||
lastEvent = {event : eventName, params: eventParams};
|
||||
document.getElementById("event_producer").click();
|
||||
|
||||
let lastEvent = new MouseEvent('click');
|
||||
lastEvent.eventData1C = {event : eventName, params: eventParams};
|
||||
return dispatchEvent(lastEvent);
|
||||
|
||||
}
|
||||
|
||||
setText = function(txt, range) {
|
||||
|
@ -19,8 +19,7 @@
|
||||
|
||||
<body>
|
||||
|
||||
<div id="container"></div>
|
||||
<button id="event_producer" style="display: none"></button>
|
||||
<div id="container"></div>
|
||||
|
||||
<script>
|
||||
function getCode() {
|
||||
|
@ -73,8 +73,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="container" style="width:100%;height:400px;border:1px solid grey"></div>
|
||||
<button id="event_button" style="display: none"></button>
|
||||
<div id="container" style="width:100%;height:400px;border:1px solid grey"></div>
|
||||
|
||||
<script src="./vs/loader.js"></script>
|
||||
<script src="./bsl_helper.js"></script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user