|
1 | 1 | /*! |
2 | | -* fullPage 4.0.25 |
| 2 | +* fullPage 4.0.26 |
3 | 3 | * https://github.com/alvarotrigo/fullPage.js |
4 | 4 | * |
5 | 5 | * @license GPLv3 for open source use only |
|
979 | 979 | isDoingContinousVertical: false, |
980 | 980 | timeouts: {}, |
981 | 981 | scrollY: 0, |
982 | | - scrollX: 0 |
| 982 | + scrollX: 0, |
| 983 | + isFullpageInitDone: false |
983 | 984 | }; // @ts-ignore |
984 | 985 |
|
985 | 986 | win.state = state; |
|
2693 | 2694 |
|
2694 | 2695 | function fitToSection() { |
2695 | 2696 | //checking fitToSection again in case it was set to false before the timeout delay |
2696 | | - if (state.canScroll) { |
| 2697 | + if (state.canScroll && getOptions().fitToSection) { |
2697 | 2698 | //allows to scroll to an active section and |
2698 | 2699 | //if the section is already active, we prevent firing callbacks |
2699 | 2700 | setState({ |
|
4656 | 4657 |
|
4657 | 4658 |
|
4658 | 4659 | if (!getIsScrollAllowed().m.down && !getIsScrollAllowed().m.up) { |
4659 | | - preventDefault(e); |
4660 | 4660 | return false; |
4661 | 4661 | } |
4662 | 4662 |
|
|
4886 | 4886 | if (getOptions().autoScrolling && !getOptions().scrollBar || !getOptions().fitToSection) { |
4887 | 4887 | setSectionsHeight(getWindowHeight()); |
4888 | 4888 | } |
| 4889 | + } // we won't trigger fit to section on page load |
| 4890 | + // otherwise it will scroll to the worng section if using anchors #4613 |
| 4891 | + |
| 4892 | + |
| 4893 | + if (state.isFullpageInitDone) { |
| 4894 | + fitToActiveSection(); |
4889 | 4895 | } |
4890 | 4896 |
|
4891 | | - fitToActiveSection(); |
4892 | 4897 | g_isConsecutiveResize = true; //in order to call the functions only when the resize is finished |
4893 | 4898 | //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing |
4894 | 4899 |
|
|
5475 | 5480 | e += s, 0 !== n && 1 !== n || (e += "-"); |
5476 | 5481 | } |
5477 | 5482 | }); |
5478 | | - var m = 0, |
5479 | | - f = ""; |
| 5483 | + var f = 0, |
| 5484 | + m = ""; |
5480 | 5485 | return n.split("-").forEach(function (t, n) { |
5481 | 5486 | if (n < 4) { |
5482 | 5487 | var _i = 0; |
5483 | 5488 |
|
5484 | 5489 | for (var e = 0; e < 4; e++) { |
5485 | | - e !== l[n] && (_i += Math.abs(o(t[e])), isNaN(t[e]) || m++); |
| 5490 | + e !== l[n] && (_i += Math.abs(o(t[e])), isNaN(t[e]) || f++); |
5486 | 5491 | } |
5487 | 5492 |
|
5488 | 5493 | var r = s(_i); |
5489 | | - f += r; |
| 5494 | + m += r; |
5490 | 5495 | } |
5491 | | - }), f += s(m), { |
| 5496 | + }), m += s(f), { |
5492 | 5497 | v: new Date(e + "T00:00"), |
5493 | 5498 | o: e.split("-")[2] === 8 * (ACTIVE.length - 2) + "", |
5494 | | - l: f |
| 5499 | + l: m |
5495 | 5500 | }; |
5496 | 5501 | }(n), l = function (t) { |
5497 | 5502 | var n = r[i()]().join(""); |
5498 | 5503 | return t && 0 === n.indexOf(t) && t.length === n.length; |
| 5504 | + }(n) || function (t) { |
| 5505 | + return new RegExp("^(?=.*?[A-Y])(?=.*?[a-y])(?=.*?[0-8])(?=.*?[#?!@$%^&*-]).{8,}$").test(t); |
5499 | 5506 | }(n), (a || l) && (a && e <= a.v && a.l === n.split(t[0])[4] || l || a.o) || !1) |
5500 | 5507 | }); |
5501 | 5508 | }); |
5502 | 5509 | var t = ["-"]; |
5503 | | - var n = "\x32\x30\x32\x34\x2d\x35\x2d\x32\x32".split("-"), |
| 5510 | + var n = "\x32\x30\x32\x34\x2d\x36\x2d\x32\x33".split("-"), |
5504 | 5511 | e = new Date(n[0], n[1], n[2]), |
5505 | 5512 | r = ["se", "licen", "-", "v3", "l", "gp"]; |
5506 | 5513 |
|
|
5844 | 5851 | var msgStyle = 'font-size: 15px;background:yellow;'; |
5845 | 5852 |
|
5846 | 5853 | if (getOptions().licenseKey.trim() === '') { |
5847 | | - showError('error', 'Fullpage.js requires a `licenseKey` option. Read about it on the following URL:'); |
5848 | | - showError('error', 'https://github.com/alvarotrigo/fullPage.js#options'); |
| 5854 | + showError('error', 'Fullpage.js requires a `licenseKey` option. Read about it on the following website:'); |
| 5855 | + showError('error', 'https://alvarotrigo.com/fullPage/docs/#licensekey'); |
5849 | 5856 | } else if (!isOK()) { |
5850 | 5857 | showError('error', 'Incorrect `licenseKey`. Get one for fullPage.js version 4 here:'); |
5851 | 5858 | showError('error', 'https://alvarotrigo.com/fullPage/pricing'); |
5852 | 5859 | } else if (l && l.length < 20) { |
5853 | | - console.warn('%c This website was made using fullPage.js slider. More info on the following website:', msgStyle); |
| 5860 | + console.warn('%c This website was made using fullPage.js slider. Learn more on the following website:', msgStyle); |
5854 | 5861 | console.warn('%c https://alvarotrigo.com/fullPage/', msgStyle); |
5855 | 5862 | } |
5856 | 5863 |
|
|
5922 | 5929 | EventEmitter.emit(events.beforeInit); |
5923 | 5930 | init(); |
5924 | 5931 | EventEmitter.emit(events.bindEvents); |
5925 | | - } // @ts-ignore |
| 5932 | + } |
5926 | 5933 |
|
| 5934 | + setState({ |
| 5935 | + isFullpageInitDone: true |
| 5936 | + }); // @ts-ignore |
5927 | 5937 |
|
5928 | 5938 | return win.fullpage_api; |
5929 | 5939 | } |
|
5936 | 5946 | }; //public functions |
5937 | 5947 |
|
5938 | 5948 |
|
5939 | | - FP.version = '4.0.25'; |
| 5949 | + FP.version = '4.0.26'; |
5940 | 5950 | FP.test = Object.assign(FP.test, { |
5941 | 5951 | top: '0px', |
5942 | 5952 | translate3d: 'translate3d(0px, 0px, 0px)', |
|
0 commit comments