Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 169 | Rev 171 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 169 Rev 170
Línea 1107... Línea 1107...
1107
        var slug = $(this).data('section');
1107
        var slug = $(this).data('section');
1108
        var section;
1108
        var section;
1109
        var showForm = false;
1109
        var showForm = false;
1110
        for (i = 0; i < objFormGenerator.sections.length; i++) {
1110
        for (i = 0; i < objFormGenerator.sections.length; i++) {
1111
            section = objFormGenerator.sections[i];
1111
            section = objFormGenerator.sections[i];
1112
            if (slug == section.slug) {
1112
            if (slug == section.section_slug) {
1113
                validatorFormSection.resetForm();
1113
                validatorFormSection.resetForm();
1114
                $('#form-section #section-slug').val(section.slug);
1114
                $('#form-section #section-slug').val(section.section_slug);
1115
                $('#form-section #section-name').val(section.name);
1115
                $('#form-section #section-name').val(section.name);
1116
                instanceName = 'section-text';
1116
                instanceName = 'section-text';
1117
                let editor = CKEDITOR.instances[instanceName];
1117
                let editor = CKEDITOR.instances[instanceName];
1118
                editor.setData(section.text, function() {
1118
                editor.setData(section.text, function() {
1119
                    editor.focus();
1119
                    editor.focus();
Línea 1173... Línea 1173...
1173
        $('#modal-question').modal('show');
1173
        $('#modal-question').modal('show');
1174
    });
1174
    });
1175
    $('body').on('click', 'button.btn-edit-question', function(e) {
1175
    $('body').on('click', 'button.btn-edit-question', function(e) {
1176
        e.preventDefault();
1176
        e.preventDefault();
1177
        var slug_section = $(this).data('section');
1177
        var slug_section = $(this).data('section');
1178
        var slug = $(this).data('slug');
1178
        var slug = $(this).data('question');
1179
        var showForm = false;
1179
        var showForm = false;
1180
        for (i = 0; i < objFormGenerator.sections.length; i++) {
1180
        for (i = 0; i < objFormGenerator.sections.length; i++) {
1181
            if (slug_section == objFormGenerator.sections[i].slug_section) {
1181
            if (slug_section == objFormGenerator.sections[i].slug_section) {
1182
                for (j = 0; j < objFormGenerator.sections[i].questions.length; j++) {
1182
                for (j = 0; j < objFormGenerator.sections[i].questions.length; j++) {
1183
                    if (slug == objFormGenerator.sections[i].questions[j].slug_question) {
1183
                    if (slug == objFormGenerator.sections[i].questions[j].slug_question) {
Línea 1222... Línea 1222...
1222
        }
1222
        }
1223
    });
1223
    });
1224
    $('body').on('click', 'button.btn-delete-question', function(e) {
1224
    $('body').on('click', 'button.btn-delete-question', function(e) {
1225
        e.preventDefault();
1225
        e.preventDefault();
1226
        var slug_section = $(this).data('section');
1226
        var slug_section = $(this).data('section');
1227
        var slug = $(this).data('slug');
1227
        var slug = $(this).data('question');
1228
        bootbox.confirm({
1228
        bootbox.confirm({
1229
            title: "LABEL_DELETE LABEL_QUESTION",
1229
            title: "LABEL_DELETE LABEL_QUESTION",
1230
            message: "LABEL_QUESTION_DELETE",
1230
            message: "LABEL_QUESTION_DELETE",
1231
            buttons: {
1231
            buttons: {
1232
                cancel: {
1232
                cancel: {