| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 34 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | /** global: GLSR, jQuery */ | ||
| 2 | ;(function( $ ) { | ||
| 3 | |||
| 4 | 'use strict'; | ||
| 5 | |||
| 6 | 	GLSR.Pointers = function() { | ||
| 7 | 		$.each( GLSR.pointers, function( i, pointer ) { | ||
| 8 | this.init_( pointer ); | ||
| 9 | }.bind( this )); | ||
| 10 | }; | ||
| 11 | |||
| 12 | 	GLSR.Pointers.prototype = { | ||
| 13 | /** @return void */ | ||
| 14 | 		close_: function( pointerId ) { // string | ||
| 15 | 			$.post( GLSR.ajaxurl, { | ||
| 16 | action: 'dismiss-wp-pointer', | ||
| 17 | pointer: pointerId, | ||
| 18 | }); | ||
| 19 | }, | ||
| 20 | |||
| 21 | /** @return void */ | ||
| 22 | 		init_: function( pointer ) { // object | ||
| 23 | 			$( pointer.target ).pointer({ | ||
| 24 | content: pointer.options.content, | ||
| 25 | position: pointer.options.position, | ||
| 26 | close: this.close_.bind( pointer.id ), | ||
| 27 | }) | ||
| 28 | .pointer( 'open' ) | ||
| 29 | .pointer( 'sendToTop' ); | ||
| 30 | 			$( document ).on( 'wp-window-resized', function() { | ||
| 31 | $( pointer.target ).pointer( 'reposition' ); | ||
| 32 | }); | ||
| 33 | }, | ||
| 34 | }; | ||
| 35 | })( jQuery ); | ||
| 36 |