|
|
@ -22,36 +22,39 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
for (var base in settings.spinner) { |
|
|
|
for (var base in settings.spinner) { |
|
|
|
var id = '#' + base; |
|
|
|
var id = '#' + base; |
|
|
|
$(id, context).once('spinner', function () { |
|
|
|
// Don't add spinner to the hidden next/ingest button.
|
|
|
|
var spinner = new Spinner(settings.spinner[base].opts); |
|
|
|
if (id != '#edit-hidden-next') { |
|
|
|
$(id).parents('form').one('submit', function(event) { |
|
|
|
$(id, context).once('spinner', function () { |
|
|
|
if ($(this).data('clicked').is(id)) { |
|
|
|
var spinner = new Spinner(settings.spinner[base].opts); |
|
|
|
event.preventDefault(); |
|
|
|
$(id).parents('form').one('submit', function (event) { |
|
|
|
// Add Message.
|
|
|
|
if ($(this).data('clicked').is(id)) { |
|
|
|
var message = $('<div/>').text(settings.spinner[base].message); |
|
|
|
event.preventDefault(); |
|
|
|
$(id).after(message); |
|
|
|
// Add Message.
|
|
|
|
// Make UI changes.
|
|
|
|
var message = $('<div/>').text(settings.spinner[base].message); |
|
|
|
spinner.spin(this); |
|
|
|
$(id).after(message); |
|
|
|
$('#edit-next').hide(); |
|
|
|
// Make UI changes.
|
|
|
|
$('#edit-prev').hide();
|
|
|
|
spinner.spin(this); |
|
|
|
// Submit the form after a set timeout, this handles problems with
|
|
|
|
$('#edit-next').hide(); |
|
|
|
// safari, in that safari submit's immediately..
|
|
|
|
$('#edit-prev').hide(); |
|
|
|
if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) {
|
|
|
|
// Submit the form after a set timeout, this handles problems with
|
|
|
|
$(':submit').attr('disabled', 'disabled'); |
|
|
|
// safari, in that safari submit's immediately..
|
|
|
|
|
|
|
|
if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) { |
|
|
|
|
|
|
|
$(':submit').attr('disabled', 'disabled'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
setTimeout(function () { |
|
|
|
|
|
|
|
// Allow for the button to be clicked, then click it then
|
|
|
|
|
|
|
|
// prevent the default behavoir.
|
|
|
|
|
|
|
|
$(id).removeAttr('disabled') |
|
|
|
|
|
|
|
.click() |
|
|
|
|
|
|
|
.click(function (event) { |
|
|
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, 500); |
|
|
|
} |
|
|
|
} |
|
|
|
setTimeout(function() { |
|
|
|
return true; |
|
|
|
// Allow for the button to be clicked, then click it then
|
|
|
|
}); |
|
|
|
// prevent the default behavoir.
|
|
|
|
|
|
|
|
$(id).removeAttr('disabled') |
|
|
|
|
|
|
|
.click() |
|
|
|
|
|
|
|
.click(function(event) { |
|
|
|
|
|
|
|
event.preventDefault(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, 500); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|