Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Commit

Permalink
Foundation build to bower-foundation
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurzurb committed Oct 9, 2015
1 parent 79620ea commit 17c2273
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 17 deletions.
3 changes: 3 additions & 0 deletions css/foundation.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/foundation.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/foundation.min.css

Large diffs are not rendered by default.

34 changes: 28 additions & 6 deletions js/foundation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4286,8 +4286,8 @@
}

if (settings.navigation_arrows) {
container.append($('<a href="#"><span></span></a>').addClass(settings.prev_class));
container.append($('<a href="#"><span></span></a>').addClass(settings.next_class));
container.append($('<a href="#" title="'+settings.prev_text+'"><span></span></a>').addClass(settings.prev_class).append('<span class="visuallyhidden">'+settings.prev_text+'</span>'));
container.append($('<a href="#" title="'+settings.next_text+'"><span></span></a>').addClass(settings.next_class).append('<span class="visuallyhidden">'+settings.next_text+'</span>'));
}

if (settings.timer) {
Expand Down Expand Up @@ -4674,7 +4674,9 @@
variable_height : false,
swipe : true,
before_slide_change : noop,
after_slide_change : noop
after_slide_change : noop,
prev_text: 'Previous slide',
next_text: 'Next slide'
},

init : function (scope, method, options) {
Expand Down Expand Up @@ -4781,6 +4783,7 @@
S(document)
.on('click.fndtn.reveal', this.close_targets(), function (e) {
e.preventDefault();

if (!self.locked) {
var settings = S('[' + self.attr_name() + '].open').data(self.attr_name(true) + '-init') || self.settings,
bg_clicked = S(e.target)[0] === S('.' + settings.bg_class)[0];
Expand Down Expand Up @@ -4952,6 +4955,23 @@
$.ajax(ajax_settings);
}
}

// trap the focus within the modal while tabbing
self.S(modal).on('keydown', function(e) {
var visibleFocusableElements = modal.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function() {
if (!$(this).is(':visible') || $(this).attr('tabindex') < 0) return false; //only have visible elements and those that have a tabindex greater or equal 0
return true;
});
if (e.keyCode === 9) { // tab is pressed
if (e.shiftKey && self.S(modal).find(':focus').is(visibleFocusableElements.eq(0))) { // left modal downwards, setting focus to first element
visibleFocusableElements.eq(-1).focus();
e.preventDefault();
} else if (!e.shiftKey && self.S(modal).find(':focus').is(visibleFocusableElements.eq(-1))) { // left modal downwards, setting focus to first element
visibleFocusableElements.eq(0).focus();
e.preventDefault();
}
}
});
self.S(window).trigger('resize');
},

Expand Down Expand Up @@ -5065,7 +5085,8 @@
context.locked = false;
el.trigger('opened.fndtn.reveal');
})
.addClass('open');
.addClass('open')
.focus();
}, settings.animation_speed / 2);
}

Expand All @@ -5081,7 +5102,8 @@
context.locked = false;
el.trigger('opened.fndtn.reveal');
})
.addClass('open');
.addClass('open')
.focus();
}, settings.animation_speed / 2);
}

Expand All @@ -5097,7 +5119,7 @@

this.locked = false;

return el.show();
return el.show().focus();
},

to_back : function(el) {
Expand Down
4 changes: 2 additions & 2 deletions js/foundation.min.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions js/foundation/foundation.orbit.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
}

if (settings.navigation_arrows) {
container.append($('<a href="#"><span></span></a>').addClass(settings.prev_class));
container.append($('<a href="#"><span></span></a>').addClass(settings.next_class));
container.append($('<a href="#" title="'+settings.prev_text+'"><span></span></a>').addClass(settings.prev_class).append('<span class="visuallyhidden">'+settings.prev_text+'</span>'));
container.append($('<a href="#" title="'+settings.next_text+'"><span></span></a>').addClass(settings.next_class).append('<span class="visuallyhidden">'+settings.next_text+'</span>'));
}

if (settings.timer) {
Expand Down Expand Up @@ -442,7 +442,9 @@
variable_height : false,
swipe : true,
before_slide_change : noop,
after_slide_change : noop
after_slide_change : noop,
prev_text: 'Previous slide',
next_text: 'Next slide'
},

init : function (scope, method, options) {
Expand Down
26 changes: 23 additions & 3 deletions js/foundation/foundation.reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
S(document)
.on('click.fndtn.reveal', this.close_targets(), function (e) {
e.preventDefault();

if (!self.locked) {
var settings = S('[' + self.attr_name() + '].open').data(self.attr_name(true) + '-init') || self.settings,
bg_clicked = S(e.target)[0] === S('.' + settings.bg_class)[0];
Expand Down Expand Up @@ -243,6 +244,23 @@
$.ajax(ajax_settings);
}
}

// trap the focus within the modal while tabbing
self.S(modal).on('keydown', function(e) {
var visibleFocusableElements = modal.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function() {
if (!$(this).is(':visible') || $(this).attr('tabindex') < 0) return false; //only have visible elements and those that have a tabindex greater or equal 0
return true;
});
if (e.keyCode === 9) { // tab is pressed
if (e.shiftKey && self.S(modal).find(':focus').is(visibleFocusableElements.eq(0))) { // left modal downwards, setting focus to first element
visibleFocusableElements.eq(-1).focus();
e.preventDefault();
} else if (!e.shiftKey && self.S(modal).find(':focus').is(visibleFocusableElements.eq(-1))) { // left modal downwards, setting focus to first element
visibleFocusableElements.eq(0).focus();
e.preventDefault();
}
}
});
self.S(window).trigger('resize');
},

Expand Down Expand Up @@ -356,7 +374,8 @@
context.locked = false;
el.trigger('opened.fndtn.reveal');
})
.addClass('open');
.addClass('open')
.focus();
}, settings.animation_speed / 2);
}

Expand All @@ -372,7 +391,8 @@
context.locked = false;
el.trigger('opened.fndtn.reveal');
})
.addClass('open');
.addClass('open')
.focus();
}, settings.animation_speed / 2);
}

Expand All @@ -388,7 +408,7 @@

this.locked = false;

return el.show();
return el.show().focus();
},

to_back : function(el) {
Expand Down
10 changes: 9 additions & 1 deletion scss/foundation/components/_reveal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ $reveal-close-top: rem-calc(10) !default;
$reveal-close-side: rem-calc(22) !default;
$reveal-close-color: $base !default;
$reveal-close-weight: $font-weight-bold !default;
$reveal-close-padding: 0 !default;
$reveal-close-background-color: transparent !default;
$reveal-close-border: none !default;

// We use this to set the default radius used throughout the core.
$reveal-radius: $global-radius !default;
Expand Down Expand Up @@ -162,6 +165,9 @@ $z-index-base: 1005;
line-height: 1;
position: absolute;
top: $reveal-close-top;
padding: $reveal-close-padding;
background-color: $reveal-close-background-color;
border: $reveal-close-border;
#{$opposite-direction}: $reveal-close-side;
}

Expand Down Expand Up @@ -206,7 +212,9 @@ $z-index-base: 1005;
z-index: $z-index-base - 2;
}

.#{$close-reveal-modal-class} { @include reveal-close; }
.#{$close-reveal-modal-class} {
@include reveal-close;
}
}
}
}

0 comments on commit 17c2273

Please sign in to comment.