templates: moved js script implementing the behavior of the password field in the _create_course.html template
This commit is contained in:
parent
2d6c2d85bb
commit
6b5ffc81a9
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
|
|
Reference in New Issue