Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit ffa1b1c

Browse files
committed
cleanup and dialog added
1 parent f2e83a5 commit ffa1b1c

File tree

1 file changed

+43
-18
lines changed
  • magnific_popup/blocks/magnific_popup

1 file changed

+43
-18
lines changed
+43-18
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,44 @@
1-
hideAllTheDivs = function() {
2-
$('#single-options, #singleImage, #galleryImages, #youtubeThumb, #vimeoThumb').hide();
1+
hideAllDivs = function() {
2+
$("#single-options").hide();
3+
$("#singleImage").hide();
4+
$("#galleryImages").hide();
5+
6+
$("#youtubeThumb").hide();
7+
$("#vimeoThumb").hide();
8+
$("#animationDialog").hide();
39
};
410

5-
handleSelection = function() {
6-
hideAllTheDivs();
11+
handleNewSelection = function() {
12+
13+
hideAllDivs();
714

815
switch ($(this).val()) {
9-
case 'single':
10-
$('#singleImage').show("slow");
11-
$('#single-options').show("slow");
16+
case 'single':
17+
$("#single-options").show();
18+
$("#singleImage").show();
19+
$("#vidMap").hide();
1220
break;
1321
case 'popup':
14-
$('#galleryImages').show("slow");
22+
$("#galleryImages").show();
23+
$("#vidMap").hide();
1524
break;
1625
case 'zoom':
17-
$('#singleImage').show("slow");
26+
$("#singleImage").show();
27+
$("#vidMap").hide();
1828
break;
1929
case 'vidMap':
20-
$('#vidMap').show("slow");
30+
$("#vidMap").show();
2131
break;
2232
case 'youtubeThumb':
23-
$('#youtubeThumb').show("slow");
33+
$("#youtubeThumb").show();
34+
break;
2435
case 'vimeoThumb':
25-
$('#vimeoThumb').show("slow");
36+
$("#vimeoThumb").show();
37+
break;
38+
case 'cssdialog':
39+
$("#animationDialog").show();
40+
$("#vidMap").hide();
41+
break;
2642
}
2743
};
2844

@@ -32,27 +48,36 @@ function ccmValidateBlockForm() {
3248
if ($('#magnific_type').val() == 'select1') {
3349
ccm_addError(ccm_t('selection-required'));
3450
}
35-
if ($('#magnific_type').val() == 'single' && $("#ccm-b-image-fm-value").val() == 0) {
51+
if ($('#magnific_type').val() == 'single' && $("#ccm-b-image-fm-value").val() === 0) {
3652
ccm_addError(ccm_t('image-required'));
3753
}
3854
if ($('#magnific_type').val() == 'single' && $('#singleOption').val() == 'select-2') {
3955
ccm_addError(ccm_t('single-option-required'));
4056
}
41-
if ($('#magnific_type').val() == 'popup' && $('#fsID').val() == '') {
57+
if ($('#magnific_type').val() == 'popup' && $('#fsID').val() === '') {
4258
ccm_addError(ccm_t('gallery-required'));
4359
}
44-
if ($('#magnific_type').val() == 'zoom' && $("#ccm-b-image-fm-value").val() == 0) {
60+
if ($('#magnific_type').val() == 'zoom' && $("#ccm-b-image-fm-value").val() === 0) {
4561
ccm_addError(ccm_t('image-required'));
4662
}
4763
if ($('#magnific_type').val() == 'vidMap' && $('#videoOptions').val() == 'select-3') {
4864
ccm_addError(ccm_t('video-map-selection-required'));
4965
}
50-
if ($('#magnific_type').val() == 'vidMap' && $('#vidMapURL').val() == '') {
66+
if ($('#magnific_type').val() == 'vidMap' && $('#vidMapURL').val() === '') {
5167
ccm_addError(ccm_t('url-requried'));
5268
}
53-
if ($('#magnific_type').val() == 'vidMap' && $('#vidMapLinkText').val() == '') {
69+
if ($('#magnific_type').val() == 'vidMap' && $('#vidMapLinkText').val() === '') {
5470
ccm_addError(ccm_t('link-text-required'));
5571
}
56-
72+
if ($('#magnific_type').val() == 'cssdialog' && $('#cssDialogLinkText').val() === '') {
73+
ccm_addError(ccm_t('dialog-link-text-required'));
74+
}
75+
if ($('#magnific_type').val() == 'cssdialog' && $('#cssDialogText').val() === '') {
76+
ccm_addError(ccm_t('dialog-text-required'));
77+
}
78+
if ($('#dialogType').val() == 'choose') {
79+
ccm_addError(ccm_t('dialog-type-required'));
80+
}
81+
5782
return false;
5883
}

0 commit comments

Comments
 (0)