Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 131... Línea 131...
131
            if (bgimageurl === null) {
131
            if (bgimageurl === null) {
132
                return; // There is not currently a valid preview to update.
132
                return; // There is not currently a valid preview to update.
133
            }
133
            }
Línea 134... Línea 134...
134
 
134
 
-
 
135
            var numDrops = dragDropToImageForm.form.getFormValue('nodropzone', []);
-
 
136
            var dropzonevisibility = dragDropToImageForm.form.getFormValue('dropzonevisibility', []);
135
            var numDrops = dragDropToImageForm.form.getFormValue('nodropzone', []);
137
            var dropzonevisibilitystyle = dropzonevisibility === '1' ? 'background: transparent;' : '';
136
            for (var dropNo = 0; dropNo < numDrops; dropNo++) {
138
            for (var dropNo = 0; dropNo < numDrops; dropNo++) {
137
                var dragNo = dragDropToImageForm.form.getFormValue('drops', [dropNo, 'choice']);
139
                var dragNo = dragDropToImageForm.form.getFormValue('drops', [dropNo, 'choice']);
138
                if (dragNo === '0') {
140
                if (dragNo === '0') {
139
                    continue;
141
                    continue;
Línea 146... Línea 148...
146
                    if (imgUrl === null) {
148
                    if (imgUrl === null) {
147
                        continue;
149
                        continue;
148
                    }
150
                    }
149
                    // Althoug these are previews of drops, we also add the class name 'drag',
151
                    // Althoug these are previews of drops, we also add the class name 'drag',
150
                    dropZoneHolder.append('<img class="droppreview group' + group + ' drop' + dropNo +
152
                    dropZoneHolder.append('<img class="droppreview group' + group + ' drop' + dropNo +
151
                            '" src="' + imgUrl + '" alt="' + label + '" data-drop-no="' + dropNo + '">');
153
                        '" src="' + imgUrl + '" alt="' + label + '" data-drop-no="' + dropNo +
-
 
154
                        '" style="' + dropzonevisibilitystyle + '" >');
Línea 152... Línea 155...
152
 
155
 
153
                } else if (label !== '') {
156
                } else if (label !== '') {
154
                    dropZoneHolder.append('<div class="droppreview group' + group + ' drop' + dropNo +
157
                    dropZoneHolder.append('<div class="droppreview group' + group + ' drop' + dropNo +
155
                        '"  data-drop-no="' + dropNo + '">' + label + '</div>');
158
                        '"  data-drop-no="' + dropNo + '">' + label + '</div>');
Línea 286... Línea 289...
286
                });
289
                });
Línea 287... Línea 290...
287
 
290
 
288
            // Changes to Drop zones section: left, top and drag item.
291
            // Changes to Drop zones section: left, top and drag item.
289
            $('fieldset#id_dropzoneheader').on('change input', 'input, select', function(e) {
292
            $('fieldset#id_dropzoneheader').on('change input', 'input, select', function(e) {
-
 
293
                var input = $(e.target).closest('select, input');
-
 
294
                if (input.attr('id') === 'id_dropzonevisibility') {
-
 
295
                    return;
-
 
296
                }
290
                var input = $(e.target).closest('select, input');
297
 
291
                if (input.is('select')) {
298
                if (input.is('select')) {
292
                    dragDropToImageForm.createDropZones();
299
                    dragDropToImageForm.createDropZones();
293
                } else {
300
                } else {
294
                    dragDropToImageForm.updateDropZones();
301
                    dragDropToImageForm.updateDropZones();
Línea 301... Línea 308...
301
            });
308
            });
Línea 302... Línea 309...
302
 
309
 
303
            $(window).on('resize', function() {
310
            $(window).on('resize', function() {
304
                dragDropToImageForm.updateDropZones();
311
                dragDropToImageForm.updateDropZones();
-
 
312
            });
-
 
313
 
-
 
314
            $('#id_dropzonevisibility').on('change', function() {
-
 
315
                let selectedvalue = $(this).val();
-
 
316
                if (selectedvalue === "1") {
-
 
317
                    $('.droppreview').css('background', 'transparent');
-
 
318
                } else if (selectedvalue === "0") {
-
 
319
                    $('.droppreview').css('background', '');
-
 
320
                }
305
            });
321
            });
Línea 306... Línea 322...
306
        },
322
        },
307
 
323
 
308
        /**
324
        /**
Línea 371... Línea 387...
371
 
387
 
372
            if (dragDropToImageForm.form.getFormValue('drags', [value - 1, 'infinite'])) {
388
            if (dragDropToImageForm.form.getFormValue('drags', [value - 1, 'infinite'])) {
373
                return false; // Infinite, so can't be used up.
389
                return false; // Infinite, so can't be used up.
Línea 374... Línea 390...
374
            }
390
            }
375
 
391
 
376
            return $('fieldset#id_dropzoneheader select').filter(function(i, selectNode) {
392
            return $('fieldset#id_dropzoneheader select[name^="drops"]').filter(function(i, selectNode) {
377
                return parseInt($(selectNode).val()) === value;
393
                return parseInt($(selectNode).val()) === value;
Línea 378... Línea 394...
378
            }).length !== 0;
394
            }).length !== 0;