Skip to content

Commit

Permalink
Merge pull request #4361 from alvarotrigo/dev
Browse files Browse the repository at this point in the history
Merging Dev branch 4.0.5
  • Loading branch information
alvarotrigo authored Apr 12, 2022
2 parents 0955c40 + 1bfdae9 commit 97bd920
Show file tree
Hide file tree
Showing 24 changed files with 56 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

---

![fullPage.js version](http://img.shields.io/badge/fullPage.js-v4.0.4-brightgreen.svg)
![fullPage.js version](http://img.shields.io/badge/fullPage.js-v4.0.5-brightgreen.svg)
[![License](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![PayPal Donate](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
Expand Down
2 changes: 1 addition & 1 deletion dist/fullpage.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* fullPage 4.0.4
* fullPage 4.0.5
* https://github.com/alvarotrigo/fullPage.js
*
* @license GPLv3 for open source use only
Expand Down
4 changes: 2 additions & 2 deletions dist/fullpage.extensions.min.js

Large diffs are not rendered by default.

27 changes: 19 additions & 8 deletions dist/fullpage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* fullPage 4.0.4
* fullPage 4.0.5
* https://github.com/alvarotrigo/fullPage.js
*
* @license GPLv3 for open source use only
Expand Down Expand Up @@ -867,6 +867,7 @@
touchDirection: 'none',
wheelDirection: 'none',
isGrabbing: false,
isUsingWheel: false,
isWindowFocused: true,
previousDestTop: 0,
windowsHeight: getWindowHeight(),
Expand Down Expand Up @@ -1786,7 +1787,7 @@

function getBulletLinkName(i, defaultName, item) {
var anchor = defaultName === 'Section' ? getOptions().anchors[i] : getAttr(item, 'data-anchor');
return getOptions().navigationTooltips[i] || anchor || defaultName + ' ' + (i + 1);
return encodeURI(getOptions().navigationTooltips[i] || anchor || defaultName + ' ' + (i + 1));
}

function slideBulletHandler(e) {
Expand Down Expand Up @@ -2354,7 +2355,7 @@
link = section.anchor;
}

li += '<li><a href="#' + link + '"><span class="fp-sr-only">' + getBulletLinkName(section.index(), 'Section') + '</span><span></span></a>'; // Only add tooltip if needed (defined by user)
li += '<li><a href="#' + encodeURI(link) + '"><span class="fp-sr-only">' + getBulletLinkName(section.index(), 'Section') + '</span><span></span></a>'; // Only add tooltip if needed (defined by user)

var tooltip = getOptions().navigationTooltips[section.index()];

Expand Down Expand Up @@ -2670,7 +2671,7 @@
var timeDiff = this.timeLastScroll - scrollOverflowHandler.timeBeforeReachingLimit;
var isUsingTouch = isTouchDevice || isTouch;
var isGrabbing = isUsingTouch && state.isGrabbing;
var isNotFirstTimeReachingLimit = !isUsingTouch && timeDiff > 600;
var isNotFirstTimeReachingLimit = state.isUsingWheel && timeDiff > 600;
return isGrabbing && timeDiff > 400 || isNotFirstTimeReachingLimit;
},
onPanelScroll: function () {
Expand Down Expand Up @@ -3715,7 +3716,8 @@

if (isReallyTouch(e)) {
setState({
isGrabbing: true
isGrabbing: true,
isUsingWheel: false
});

if (getOptions().autoScrolling) {
Expand Down Expand Up @@ -4312,7 +4314,16 @@
function MouseWheelHandler(e) {
var curTime = new Date().getTime();
var isNormalScroll = hasClass($(COMPLETELY_SEL)[0], NORMAL_SCROLL);
var isScrollAllowedBeyondFullPage = beyondFullPageHandler(getContainer(), e); //is scroll allowed?
var isScrollAllowedBeyondFullPage = beyondFullPageHandler(getContainer(), e);

if (!state.isUsingWheel) {
setState({
isGrabbing: false,
isUsingWheel: true,
touchDirection: 'none'
});
} //is scroll allowed?


if (!getIsScrollAllowed().m.down && !getIsScrollAllowed().m.up) {
preventDefault(e);
Expand Down Expand Up @@ -5113,7 +5124,7 @@
});
});
var t = ["-"];
var n = "2022-3-12".split("-"),
var n = "2022-3-13".split("-"),
e = new Date(n[0], n[1], n[2]),
i = ["se", "licen", "-", "v3", "l", "gp"];

Expand Down Expand Up @@ -5529,7 +5540,7 @@
}; //public functions


FP.version = '4.0.4';
FP.version = '4.0.5';
FP.test = Object.assign(FP.test, {
top: '0px',
translate3d: 'translate3d(0px, 0px, 0px)',
Expand Down
2 changes: 1 addition & 1 deletion dist/fullpage.min.css

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

2 changes: 1 addition & 1 deletion dist/fullpage.min.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/fullpage.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lang/chinese/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

---

![fullPage.js version](http://img.shields.io/badge/fullPage.js-v4.0.4,2-brightgreen.svg)
![fullPage.js version](http://img.shields.io/badge/fullPage.js-v4.0.5,2-brightgreen.svg)
[![License](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![PayPal Donate](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
Expand Down
2 changes: 1 addition & 1 deletion lang/french/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

---

![fullPage.js version](http://img.shields.io/badge/fullPage.js-v4.0.4-brightgreen.svg)
![fullPage.js version](http://img.shields.io/badge/fullPage.js-v4.0.5-brightgreen.svg)
[![License](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![PayPal Donate](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
Expand Down
2 changes: 1 addition & 1 deletion lang/korean/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</p>
---

![fullPage.js version](http://img.shields.io/badge/fullPage.js-v4.0.4-brightgreen.svg)
![fullPage.js version](http://img.shields.io/badge/fullPage.js-v4.0.5-brightgreen.svg)
[![License](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![PayPal](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
Expand Down
2 changes: 1 addition & 1 deletion lang/russian/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

---

![Версия fullPage.js](http://img.shields.io/badge/fullPage.js-v4.0.4-brightgreen.svg)
![Версия fullPage.js](http://img.shields.io/badge/fullPage.js-v4.0.5-brightgreen.svg)
[![Лицензия](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![Перечисление на PayPal](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
Expand Down
2 changes: 1 addition & 1 deletion lang/spanish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

---

![fullPage.js version](http://img.shields.io/badge/fullPage.js-v4.0.4-brightgreen.svg)
![fullPage.js version](http://img.shields.io/badge/fullPage.js-v4.0.5-brightgreen.svg)
[![License](https://img.shields.io/badge/License-GPL-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![PayPal Donate](https://img.shields.io/badge/donate-PayPal.me-ff69b4.svg)](https://www.paypal.me/alvarotrigo/9.95)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/fullpage.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/fullpage.js)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fullpage.js",
"version": "4.0.4",
"version": "4.0.5",
"description": "Create beautiful fullscreen snap scrolling websites",
"main": "dist/fullpage.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import resolve from "@rollup/plugin-node-resolve";
import babel from "@rollup/plugin-babel";

const licenseContent = `/*!
* fullPage 4.0.4
* fullPage 4.0.5
* https://github.com/alvarotrigo/fullPage.js
*
* @license GPLv3 for open source use only
Expand Down
2 changes: 1 addition & 1 deletion src/css/fullpage.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* fullPage 4.0.4
* fullPage 4.0.5
* https://github.com/alvarotrigo/fullPage.js
*
* @license GPLv3 for open source use only
Expand Down
1 change: 1 addition & 0 deletions src/js/common/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const state = {
touchDirection: 'none',
wheelDirection: 'none',
isGrabbing: false,
isUsingWheel: false,
isWindowFocused: true,
previousDestTop: 0,
windowsHeight: utils.getWindowHeight(),
Expand Down
2 changes: 1 addition & 1 deletion src/js/fullpage.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function setAPI(){
};

//public functions
FP.version = '4.0.4';
FP.version = '4.0.5';

FP.test = Object.assign(FP.test, {
top: '0px',
Expand Down
2 changes: 1 addition & 1 deletion src/js/mixed/index.min.js

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

8 changes: 8 additions & 0 deletions src/js/mouse/wheel.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ function MouseWheelHandler(e) {
var isNormalScroll = utils.hasClass(utils.$(COMPLETELY_SEL)[0], NORMAL_SCROLL);
var isScrollAllowedBeyondFullPage = beyondFullPageHandler(getContainer(), e);

if(!state.isUsingWheel){
setState({
isGrabbing: false,
isUsingWheel: true,
touchDirection: 'none'
});
}

//is scroll allowed?
if (!getIsScrollAllowed().m.down && !getIsScrollAllowed().m.up) {
utils.preventDefault(e);
Expand Down
4 changes: 2 additions & 2 deletions src/js/nav/getBulletLinkName.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getOptions } from "../common/options.js";
*/
export function getBulletLinkName(i, defaultName, item){
var anchor = defaultName === 'Section' ? getOptions().anchors[i] : utils.getAttr(item, 'data-anchor');
return getOptions().navigationTooltips[i] ||
return encodeURI(getOptions().navigationTooltips[i] ||
anchor ||
defaultName + ' ' + (i+1);
defaultName + ' ' + (i+1));
}
4 changes: 2 additions & 2 deletions src/js/nav/sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function addVerticalNavigation(){
link = section.anchor;
}

li += '<li><a href="#' + link + '"><span class="fp-sr-only">' + getBulletLinkName(section.index(), 'Section') + '</span><span></span></a>';
li += '<li><a href="#' + encodeURI(link) + '"><span class="fp-sr-only">' + getBulletLinkName(section.index(), 'Section') + '</span><span></span></a>';

// Only add tooltip if needed (defined by user)
var tooltip = getOptions().navigationTooltips[section.index()];
Expand Down Expand Up @@ -98,4 +98,4 @@ export function sectionBulletHandler(e){
EventEmitter.emit('scrollPage', {
destination: getState().sections[indexBullet]
});
}
}
2 changes: 1 addition & 1 deletion src/js/nav/slides.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ export function addSlidesNavigation(section){

var activeSlideIndex = section.activeSlide ? section.activeSlide.index() : 0;
utils.addClass(utils.$('a', utils.$('li', nav)[activeSlideIndex] ), ACTIVE);
}
}
2 changes: 1 addition & 1 deletion src/js/scrolloverflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const scrollOverflowHandler = {
var timeDiff = this.timeLastScroll - scrollOverflowHandler.timeBeforeReachingLimit;
var isUsingTouch = isTouchDevice || isTouch;
var isGrabbing = isUsingTouch && state.isGrabbing;
var isNotFirstTimeReachingLimit = !isUsingTouch && timeDiff > 600;
var isNotFirstTimeReachingLimit = state.isUsingWheel && timeDiff > 600;

return isGrabbing && timeDiff > 400 || isNotFirstTimeReachingLimit;
},
Expand Down
5 changes: 4 additions & 1 deletion src/js/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ function touchMoveHandler(e){
var direction = isHorizontalPredominantMove ? directionH : directionV;

if (isReallyTouch(e) ) {
setState({isGrabbing: true});
setState({
isGrabbing: true,
isUsingWheel: false
});

if(getOptions().autoScrolling){
if(!hasActiveSectionOverflow || (hasActiveSectionOverflow && !state.canScroll)){
Expand Down

0 comments on commit 97bd920

Please sign in to comment.