@@ -8,39 +8,42 @@ function _GRCRTMovedFrames(){
8
8
} , 500 ) ;
9
9
return ;
10
10
}
11
+ var
12
+ tacl_id = '#toolbar_activity_commands_list' ,
13
+ tacl_clk = '.activity.commands' ,
14
+ target_tacl = document . querySelector ( tacl_id ) ;
11
15
// command list
12
16
if ( $ ( '#grcrt_taclWrap' ) . length == 0 ) {
13
17
$ ( '#toolbar_activity_commands_list' ) . wrap ( $ ( '<div/>' , { 'class' :'grcrt_taclWrap' , 'id' :'grcrt_taclWrap' } ) )
14
18
if ( RepConv . settings [ RepConv . Cookie + '_tacl' ] ) {
15
19
$ ( '#toolbar_activity_commands_list' ) . addClass ( 'grcrt_tacl' )
16
20
$ ( '#grcrt_taclWrap' ) . draggable ( ) . draggable ( 'enable' )
21
+ var
22
+ observer_tacl = new MutationObserver ( function ( mutations ) {
23
+ mutations . forEach ( function ( mutation ) {
24
+ if ( $ ( target_tacl ) . hasClass ( 'grcrt_tacl' ) && ( $ ( '#grcrt_taclWrap' ) . attr ( 'style' ) && $ ( target_tacl ) . css ( 'display' ) == "none" ) ) {
25
+ $ ( tacl_clk ) . trigger ( 'mouseenter' )
26
+ }
27
+ } ) ;
28
+ } ) ;
29
+ if ( $ ( tacl_id + ">.js-dropdown-list>a.cancel" ) . length == 0 ) {
30
+ $ ( tacl_id + ">.js-dropdown-list" )
31
+ . append (
32
+ $ ( '<a/>' , { 'href' :'#n' , 'class' :'cancel' , 'style' :'display:none;' } )
33
+ . click ( function ( ) {
34
+ $ ( '#grcrt_taclWrap' ) . removeAttr ( 'style' )
35
+ } )
36
+ )
37
+ }
38
+ observer_tacl . observe ( target_tacl , { attributes : true , childList : false , characterData : false } ) ;
17
39
} else {
18
40
$ ( '#toolbar_activity_commands_list' ) . removeClass ( 'grcrt_tacl' )
19
41
$ ( '#grcrt_taclWrap' ) . draggable ( ) . draggable ( 'disable' ) . removeAttr ( 'style' )
20
42
}
21
43
}
22
-
23
- var
24
- tacl_id = '#toolbar_activity_commands_list' ,
25
- tacl_clk = '.activity.commands' ,
26
- target_tacl = document . querySelector ( tacl_id ) ,
27
- observer_tacl = new MutationObserver ( function ( mutations ) {
28
- mutations . forEach ( function ( mutation ) {
29
- if ( $ ( target_tacl ) . hasClass ( 'grcrt_tacl' ) && ( $ ( '#grcrt_taclWrap' ) . attr ( 'style' ) && $ ( target_tacl ) . css ( 'display' ) == "none" ) ) {
30
- $ ( tacl_clk ) . trigger ( 'mouseenter' )
31
- }
32
- } ) ;
33
- } ) ;
34
- if ( $ ( tacl_id + ">.js-dropdown-list>a.cancel" ) . length == 0 ) {
35
- $ ( tacl_id + ">.js-dropdown-list" )
36
- . append (
37
- $ ( '<a/>' , { 'href' :'#n' , 'class' :'cancel' , 'style' :'display:none;' } )
38
- . click ( function ( ) {
39
- $ ( '#grcrt_taclWrap' ) . removeAttr ( 'style' )
40
- } )
41
- )
44
+ if ( $ ( target_tacl ) . hasClass ( 'grcrt_tacl' ) && ( $ ( '#grcrt_taclWrap' ) . attr ( 'style' ) /*&& $(target_tacl).css('display')=="none"*/ ) ) {
45
+ $ ( tacl_clk ) . trigger ( 'mouseenter' )
42
46
}
43
- observer_tacl . observe ( target_tacl , { attributes : true , childList : false , characterData : false } ) ;
44
47
}
45
48
46
49
// function activity_trades_list(){
@@ -136,4 +139,10 @@ function _GRCRTMovedFrames(){
136
139
activity_commands_list ( ) ;
137
140
// activity_trades_list();
138
141
} ) ;
142
+ $ . Observer ( GameEvents . command . send_unit )
143
+ . subscribe ( 'GRCRTMovedFrames_command_send' , function ( ) {
144
+ activity_commands_list ( ) ;
145
+ // activity_trades_list();
146
+ } ) ;
147
+
139
148
}
0 commit comments