Skip to content

Instantly share code, notes, and snippets.

@JoaoVagner
Created September 26, 2014 18:00
Show Gist options
  • Save JoaoVagner/a28f2b7a7f82050d2f0b to your computer and use it in GitHub Desktop.
Save JoaoVagner/a28f2b7a7f82050d2f0b to your computer and use it in GitHub Desktop.
App.Ingresse.ClickLogin = function() {
var target = $('a#sync_ingresse');
target.bind('click', function(event) {
event.preventDefault();
$loadingBtn = $(this);
oldText = $loadingBtn.text();
stringIcon = '<i class="fa fa-spinner fa-spin"></i> ';
$loadingBtn.html(stringIcon + oldText);
$.ajax({
url: App.ApiGateway.url,
data: {'method': 'login'},
type: 'POST',
dataType: 'json',
success: function(data) {
window.open(data.url, "", "toolbar=no, scrollbars=no, resizable=yes, top=500, left=500, width=400, height=800");
},
error: function() {
},
});
});
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment