forked from External/greenlight
		
	Encapsulated javascript for landingController
This commit is contained in:
		| @@ -1,3 +0,0 @@ | ||||
| # Place all the behaviors and hooks related to the matching controller here. | ||||
| # All this logic will automatically be available in application.js. | ||||
| # You can use CoffeeScript in this file: http://coffeescript.org/ | ||||
							
								
								
									
										27
									
								
								app/assets/javascripts/landing.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								app/assets/javascripts/landing.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| (function() { | ||||
|   var initIndex = function() { | ||||
|     $('#join_form_button').click (function (event) { | ||||
|       $.ajax({ | ||||
|         url : $(this).data ('url') + "?name=" + $('#join_form_name').val(), | ||||
|         dataType : "json", | ||||
|         async : true, | ||||
|         type : 'GET', | ||||
|         success : function(data) { | ||||
|           $(location).attr("href", data.response.join_url); | ||||
|         }, | ||||
|         error : function(xhr, status, error) { | ||||
|         }, | ||||
|         complete : function(xhr, status) { | ||||
|         } | ||||
|       }); | ||||
|     }); | ||||
|   }; | ||||
|  | ||||
|   $(document).on("turbolinks:load", function() { | ||||
|     if ($("body[data-controller=landing]").get(0)) { | ||||
|       if ($("body[data-action=index]").get(0)) { | ||||
|         initIndex(); | ||||
|       } | ||||
|     } | ||||
|   }); | ||||
| }).call(this); | ||||
		Reference in New Issue
	
	Block a user