Passed
Push — master ( 06bde6...6d2f62 )
by Paul
04:59
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
			};
15
			(new GLSR.Ajax( request, ev )).post( function( response ) {
16
				GLSR.Notices( response.notices );
17
				x( '#log-file' ).val( response.logger );
18
			});
19
		},
20
	};
21
22
	GLSR.Logger = Logger;
23
})( jQuery );
24