scinote-web/app/assets/javascripts/experiments/index.js

30 lines
757 B
JavaScript
Raw Normal View History

2016-07-28 20:44:44 +08:00
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
(function(){
// Initialize new experiment form
function initializeNewExperimentModal(){
$("#new-experiment")
.on("ajax:beforeSend", function(){
animateSpinner();
2016-07-28 20:44:44 +08:00
})
.on("ajax:success", function(e, data){
$('body').append($.parseHTML(data.html));
$('#new-experiment-modal').modal('show',{
backdrop: true,
keyboard: false,
});
})
.on("ajax:error", function() {
animateSpinner(null, false);
2016-07-28 20:44:44 +08:00
// TODO
})
.on("ajax:complete", function(){
animateSpinner(null, false);
2016-07-28 20:44:44 +08:00
});
}
initializeNewExperimentModal();
})();