Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Features
~~~~~~~~

- pat-scroll: To define the scrollable target search also for `overflow-x` and `overflow-y` declarations.
- Rework push message support for the STOMP message protocoll instead of backends instead of WAMP.
We are using the RabbitMQ message broker for push support instead of crossbar.io.
- Navigation:
Expand Down
9 changes: 6 additions & 3 deletions src/pat/scroll/scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,19 @@ define([
fragment = this.options.selector;
} else {
href = this.$el.attr('href');
fragment = href.indexOf('#') !== -1 && '#' + href.split('#').pop() || undefined;
fragment = href.indexOf('#') !== -1 ? '#' + href.split('#').pop() : undefined;
}
var target = $(fragment);
if (target.length === 0) {
return;
}

scrollable = $(target.parents().filter(function() {
return ( $(this).css('overflow') === 'auto' ||
$(this).css('overflow') === 'scroll' );
return (
['auto', 'scroll'].indexOf($(this).css('overflow')) > -1 ||
(scroll === 'scrollTop' && ['auto', 'scroll'].indexOf($(this).css('overflow-y')) > -1) ||
(scroll === 'scrollLeft' && ['auto', 'scroll'].indexOf($(this).css('overflow-x')) > -1)
);
}).first())

if ( typeof scrollable[0] === 'undefined' ) {
Expand Down