File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ var gmail = Gmail();
9898 - ` poll `
9999 - ` new_email `
100100 - ` refresh `
101- - gmail.observe ** .off()**
101+ - gmail.observe ** .off(action )**
102102
103103
104104### DOM
Original file line number Diff line number Diff line change @@ -687,11 +687,17 @@ var Gmail = function() {
687687 }
688688
689689
690- api . observe . off = function ( ) {
691- var win = top . document . getElementById ( "js_frame" ) . contentDocument . defaultView ;
692- win . XMLHttpRequest . prototype . open = api . tracker . xhr_open ;
693- win . XMLHttpRequest . prototype . send = api . tracker . xhr_send ;
694- api . tracker . xhr_init = false
690+ api . observe . off = function ( action ) {
691+ if ( action ) {
692+ if ( action in self . tracker . watchdog ) {
693+ delete self . tracker . watchdog [ action ] ;
694+ }
695+ } else {
696+ var win = top . document . getElementById ( "js_frame" ) . contentDocument . defaultView ;
697+ win . XMLHttpRequest . prototype . open = api . tracker . xhr_open ;
698+ win . XMLHttpRequest . prototype . send = api . tracker . xhr_send ;
699+ api . tracker . xhr_init = false
700+ }
695701 }
696702
697703
You can’t perform that action at this time.
0 commit comments