Passed
Push — master ( 32d871...06bde6 )
by Paul
06:00
created

Logger.onClick_   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
/** global: GLSR, jQuery */
2
;(function( x ) {
3
4
	'use strict';
5
6
	var Logger = function() {
7
		x( 'form' ).on( 'click', '#clear-log', this.onClick_ );
8
	};
9
10
	Logger.prototype = {
11
		onClick_: function( ev ) {
12
		 	var request = {
13
				action: 'clear-log',
14
				nonce: GLSR.logger_nonce,
15
			};
16
			GLSR.Ajax.postFromEvent( ev, request, function( response ) {
17
				GLSR.Notices( response.notices );
18
				x( '#log-file' ).val( response.logger );
19
			});
20
		},
21
	};
22
23
	GLSR.Logger = Logger;
24
})( jQuery );
25