forked from StarboyCZ/external-changes-dialog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
30 lines (25 loc) · 615 Bytes
/
main.js
File metadata and controls
30 lines (25 loc) · 615 Bytes
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
define( function( require, exports, module )
{
"use strict";
var AppInit = brackets.getModule( "utils/AppInit" );
AppInit.appReady( function()
{
// Declaration
var t, // target
c, // config of observer
o; // observer
// Parameters
t = document.body;
c = { childList: true };
// Create an observer with handler
o = new MutationObserver( function()
{
// Reference
var d = document.querySelector( "div.ext-changed-dialog button[ data-button-id='cancel' ]" );
// Action
if( d ) d.click();
});
// Start observing
o.observe( t, c );
});
});