templates: moved js script implementing the behavior of the password field in the _create_course.html template

This commit is contained in:
Benjamin Dauvergne 2012-12-05 22:47:54 +01:00
parent 2d6c2d85bb
commit 6b5ffc81a9
2 changed files with 7 additions and 8 deletions

View File

@ -17,10 +17,16 @@
<script>
$(function () {
function install_form() {
$('#id_subscription_policy').on('change', function() {
if ($(this).val() == 'password') {
$('#div_id_password').parent().show();
} else {
$('#div_id_password').parent().hide();
}
});
$('#create-course form').ajaxForm({
dataType: 'json',
success: function (content, statusText, xhr, form) {
console.log(content);
if (content.success) {
alert('Cours ' + content.course_id + ' créé.');
$('#create-course').modal('hide');

View File

@ -30,13 +30,6 @@
<script>
(function ($) {
$(function () {
$('#id_subscription_policy').on('change', function() {
if ($(this).val() == 'password') {
$('#div_id_password').parent().show();
} else {
$('#div_id_password').parent().hide();
}
});
$('#create-course').on('shown', function () {
$('.miller-columns').millercolumns('refresh');
});