Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmmartin committed Oct 22, 2009
1 parent c56b7b4 commit 88388e0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
12 changes: 10 additions & 2 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
==== SimpleModal ChangeLog ====

== 1.3.1 ==
== 1.3.2 ==
* Date: October 22, 2009
* Added autoPosition option which gives the ability to enable/disable the container positioning
* Changed data height() to outerHeight(true) and data width() to outerWidth(true). Thanks to Andrew Marcus
* Fixed bug that prevented % container dimension values from being used
* Aliased "this" to "s" wherever possible to reduce file size
* Reduced length of other internal variables to reduce file size

== 1.3.1 (never officially released) ==
* Date: September 1, 2009
* Fixed container width determination, which fixes width/centering issues in IE6
* Fixed position type checking. Thanks to cavidae for reporting
Expand All @@ -11,7 +19,7 @@
* Date: June 09, 2009
* Added autoResize option which enables/disables container resizing after window resize
* Fixed typos in dimension calculations in setContainerDimensions() function
* Added semi-colon at begining of script to prevent possible script combining/minfication issues
* Added semi-colon at beginning of script to prevent possible script combining/minfication issues
* Added e.preventDefault() to key binding event
* Moved input checking to watchTab function
* Thanks to Cedric and Tomas for reporting bugs/suggestions
Expand Down
12 changes: 7 additions & 5 deletions src/jquery.simplemodal.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@
});
}

// bind keyup events
$(document).bind('keyup.simplemodal', function (e) {
// bind keydown events
$(document).bind('keydown.simplemodal', function (e) {
if (s.o.focus && e.keyCode == 9) { // TAB
s.watchTab(e);
}
Expand Down Expand Up @@ -364,7 +364,7 @@
*/
unbindEvents: function () {
$('.' + this.o.closeClass).unbind('click.simplemodal');
$(document).unbind('keyup.simplemodal');
$(document).unbind('keydown.simplemodal');
$(window).unbind('resize.simplemodal');
this.d.overlay.unbind('click.simplemodal');
},
Expand Down Expand Up @@ -508,10 +508,12 @@

if ($(e.target).parents('.simplemodal-container').length > 0) {
// save the list of inputs
s.inputs = $(':input:enabled:visible', s.d.data[0]);
s.inputs = $(':input:enabled:visible:first, :input:enabled:visible:last', s.d.data[0]);

// if it's the first or last tabbable element, refocus
if (s.inputs.index(e.target) === -1 || s.inputs.length === 0) {
if ((!e.shiftKey && e.target == s.inputs[s.inputs.length -1]) ||
(e.shiftKey && e.target == s.inputs[0]) ||
s.inputs.length == 0) {
e.preventDefault();
var pos = e.shiftKey ? 'last' : 'first';
setTimeout(function () {s.focus(pos);}, 10);
Expand Down

0 comments on commit 88388e0

Please sign in to comment.