Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.

Commit 3f9d57c

Browse files
author
Chris Botman
committed
Fixed bug parsing some inline attributes, and lined up the documentation for 4-space tabs.
1 parent 8b9a1ea commit 3f9d57c

3 files changed

Lines changed: 101 additions & 101 deletions

File tree

dist/js/modaal.js

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,68 +7,68 @@
77
Modaal jQuery Plugin : Accessible Modals
88
99
==== General Options ===
10-
type (string) : ajax, inline, image, iframe, confirm. Defaults to 'inline'
11-
animation (string) : Fade, expand, down, up. Defaults to 'fade'
12-
after_callback_delay (integer) : Specify a delay value for the after open callbacks. This is necessary because with the bundled animations
13-
have a set duration in the bundled CSS. Specify a delay of the same amount as the animation duration in so
14-
more accurately fire the after open/close callbacks. Defaults 350, does not apply if animation is 'none',
15-
after open callbacks are dispatched immediately
10+
type (string) : ajax, inline, image, iframe, confirm. Defaults to 'inline'
11+
animation (string) : Fade, expand, down, up. Defaults to 'fade'
12+
after_callback_delay (integer) : Specify a delay value for the after open callbacks. This is necessary because with the bundled animations
13+
have a set duration in the bundled CSS. Specify a delay of the same amount as the animation duration in so
14+
more accurately fire the after open/close callbacks. Defaults 350, does not apply if animation is 'none',
15+
after open callbacks are dispatched immediately
1616
17-
is_locked (boolean) : Set this to true to disable closing the modal via keypress or clicking the background. Beware that if
18-
type != 'confirm' there will be no interface to dismiss the modal if is_locked = true, you'd have to
19-
programmatically arrange to dismiss the modal. Confirm modals are always locked regardless of this option
20-
Defaults to false
17+
is_locked (boolean) : Set this to true to disable closing the modal via keypress or clicking the background. Beware that if
18+
type != 'confirm' there will be no interface to dismiss the modal if is_locked = true, you'd have to
19+
programmatically arrange to dismiss the modal. Confirm modals are always locked regardless of this option
20+
Defaults to false
2121
22-
hide_close (boolean) : Set this to true to hide the close modal button. Key press and overlay click will still close the modal.
23-
This method is best used when you want to put a custom close button inside the modal container space.
22+
hide_close (boolean) : Set this to true to hide the close modal button. Key press and overlay click will still close the modal.
23+
This method is best used when you want to put a custom close button inside the modal container space.
2424
25-
background (string) : Background overlay style. Defaults to '#000'
26-
overlay_opacity (float) : Background overlay transparency. Defaults to 0.8
27-
overlay_close (boolean) : Set this to false if you want to disable click to close on overlay background.
25+
background (string) : Background overlay style. Defaults to '#000'
26+
overlay_opacity (float) : Background overlay transparency. Defaults to 0.8
27+
overlay_close (boolean) : Set this to false if you want to disable click to close on overlay background.
2828
29-
accessible_title (string) : Accessible title. Default 'Dialog Window'
30-
start_open (boolean) : Set this to true to launch the Modaal window immediately on page open
31-
fullscreen (boolean) : Set this to true to make the modaal fill the entire screen, false will default to own width/height attributes.
32-
custom_class (string) : Fill in this string with a custom class that will be applied to the outer most modal wrapper.
29+
accessible_title (string) : Accessible title. Default 'Dialog Window'
30+
start_open (boolean) : Set this to true to launch the Modaal window immediately on page open
31+
fullscreen (boolean) : Set this to true to make the modaal fill the entire screen, false will default to own width/height attributes.
32+
custom_class (string) : Fill in this string with a custom class that will be applied to the outer most modal wrapper.
3333
34-
width (integer) : Desired width of the modal. Required for iframe type. Defaults to undefined //TODO
35-
height (integer) : Desired height of the modal. Required for iframe type. Defaults to undefined //TODO
34+
width (integer) : Desired width of the modal. Required for iframe type. Defaults to undefined //TODO
35+
height (integer) : Desired height of the modal. Required for iframe type. Defaults to undefined //TODO
3636
3737
3838
=== Events ===
39-
before_open (function) : Callback function executed before modal is opened
40-
after_open (function) : Callback function executed after modal is opened
41-
before_close (function) : Callback function executed before modal is closed
42-
after_close (function) : Callback function executed after modal is closed
39+
before_open (function) : Callback function executed before modal is opened
40+
after_open (function) : Callback function executed after modal is opened
41+
before_close (function) : Callback function executed before modal is closed
42+
after_close (function) : Callback function executed after modal is closed
4343
source (function(element, src)) : Callback function executed on the default source, it is intended to transform the
44-
source (href in an AJAX modal or iframe). The function passes in the triggering element
45-
as well as the default source depending of the modal type. The default output of the
46-
function is an untransformed default source.
44+
source (href in an AJAX modal or iframe). The function passes in the triggering element
45+
as well as the default source depending of the modal type. The default output of the
46+
function is an untransformed default source.
4747
4848
4949
=== Confirm Options & Events ===
50-
confirm_button_text (string) : Text on the confirm button. Defaults to 'Confirm'
51-
confirm_cancel_button_text (string): Text on the confirm modal cancel button. Defaults to 'Cancel'
52-
confirm_title (string) : Title for confirm modal. Default 'Confirm Title'
53-
confirm_content (string) : HTML content for confirm message
54-
confirm_callback (function) : Callback function for when the confirm button is pressed as opposed to cancel
50+
confirm_button_text (string) : Text on the confirm button. Defaults to 'Confirm'
51+
confirm_cancel_button_text (string) : Text on the confirm modal cancel button. Defaults to 'Cancel'
52+
confirm_title (string) : Title for confirm modal. Default 'Confirm Title'
53+
confirm_content (string) : HTML content for confirm message
54+
confirm_callback (function) : Callback function for when the confirm button is pressed as opposed to cancel
5555
5656
5757
=== Gallery Options & Events ===
58-
gallery_active_class (string) : Active class applied to the currently active image or image slide in a gallery 'gallery_active_item'
59-
before_image_change (function) : Callback function executed before the image slide changes in a gallery modal. Default function( current_item, incoming_item )
60-
after_image_change (function) : Callback function executed after the image slide changes in a gallery modal. Default function ( current_item )
58+
gallery_active_class (string) : Active class applied to the currently active image or image slide in a gallery 'gallery_active_item'
59+
before_image_change (function) : Callback function executed before the image slide changes in a gallery modal. Default function( current_item, incoming_item )
60+
after_image_change (function) : Callback function executed after the image slide changes in a gallery modal. Default function ( current_item )
6161
6262
6363
=== AJAX Options & Events ===
64-
loading_content (string) : HTML content for loading message. Default 'Loading …'
65-
loading_class (string) : Class name to be applied while content is loaded via AJAX. Default 'is_loading'
66-
ajax_error_class (string) : Class name to be applied when content has failed to load. Default is 'modaal-error'
67-
ajax_success (function) : Callback for when AJAX content is loaded in
64+
loading_content (string) : HTML content for loading message. Default 'Loading …'
65+
loading_class (string) : Class name to be applied while content is loaded via AJAX. Default 'is_loading'
66+
ajax_error_class (string) : Class name to be applied when content has failed to load. Default is 'modaal-error'
67+
ajax_success (function) : Callback for when AJAX content is loaded in
6868
6969
7070
=== SOCIAL CONTENT ===
71-
instagram_id (string) : Unique photo ID for an Instagram photo.
71+
instagram_id (string) : Unique photo ID for an Instagram photo.
7272
7373
*/
7474
( function( $ ) {
@@ -944,13 +944,13 @@
944944
// option: after_callback_delay
945945
if ( self.attr('data-modaal-locked') ) {
946946
inline_options = true;
947-
options.is_locked = (self.attr('data-modaal-locked') == 'true' || true ? true : false);
947+
options.is_locked = (self.attr('data-modaal-locked') === 'true' ? true : false);
948948
}
949949

950950
// option: hide_close
951951
if ( self.attr('data-modaal-hide-close') ) {
952952
inline_options = true;
953-
options.hide_close = (self.attr('data-modaal-hide-close') == 'true' || true ? true : false);
953+
options.hide_close = (self.attr('data-modaal-hide-close') === 'true' ? true : false);
954954
}
955955

956956
// option: background
@@ -968,7 +968,7 @@
968968
// option: overlay_close
969969
if ( self.attr('data-modaal-overlay-close') ) {
970970
inline_options = true;
971-
options.overlay_close = (self.attr('data-modaal-overlay-close') == 'false' || false ? false : true);
971+
options.overlay_close = (self.attr('data-modaal-overlay-close') === 'false' ? false : true);
972972
}
973973

974974
// option: accessible_title
@@ -980,25 +980,25 @@
980980
// option: start_open
981981
if ( self.attr('data-modaal-start-open') ) {
982982
inline_options = true;
983-
options.start_open = (self.attr('data-modaal-start-open') == 'true' || true ? true : false);
983+
options.start_open = (self.attr('data-modaal-start-open') === 'true' ? true : false);
984984
}
985985

986986
// option: fullscreen
987987
if ( self.attr('data-modaal-fullscreen') ) {
988988
inline_options = true;
989-
options.fullscreen = (self.attr('data-modaal-fullscreen') == 'true' || true ? true : false);
989+
options.fullscreen = (self.attr('data-modaal-fullscreen') === 'true' ? true : false);
990990
}
991991

992-
// option: fullscreen
992+
// option: custom_class
993993
if ( self.attr('data-modaal-custom-class') ) {
994994
inline_options = true;
995995
options.custom_class = self.attr('data-modaal-custom-class');
996996
}
997997

998-
// option: fullscreen
998+
// option: background_scroll
999999
if ( self.attr('data-modaal-background-scroll') ) {
10001000
inline_options = true;
1001-
options.custom_class = (self.attr('data-modaal-background-scroll') == 'true' || true ? true : false);
1001+
options.background_scroll = (self.attr('data-modaal-background-scroll') === 'true' ? true : false);
10021002
}
10031003

10041004
// option: width
@@ -1115,7 +1115,7 @@
11151115
start_open: false,
11161116
fullscreen: false,
11171117
custom_class: '',
1118-
background_scroll: false,
1118+
background_scroll: false, // TODO: this property isn't described in the header
11191119

11201120
width: null,
11211121
height: null,

0 commit comments

Comments
 (0)