-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes - support for Apple magic mouse swipe back/forward aka Enable only if needed #378 - wrapper don't works on relative selector aka same classes not working #635 - horizontal scrollbar visibible but no need it on responsive layout - tabindex start counter fix - setAnimationFrame for IE8 - touch interaction with multiple scrollareas with IE/Edge on Surface - mousewheel not working in safari & click event trigger twice in mobile #669 - false retriggering of scrollend event - Not scrolling on lastest Firefox with HTML5 inside iframe #322 New options - scrollbarid, you can set id assigned to scrollbar (default: false = auto-assigned) Changes - some code optimizations inspired from #604 by dmadan86 (thank you so much!) - better content area size detection - remove support for Windows Phone 7 and 7.1 (mango) - minimal support change to IE8 New script iframe helper Needed to fix, in some situation, browsers bad implementation of iframe events. (#322)
- Loading branch information
Showing
15 changed files
with
2,382 additions
and
2,433 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Changelog nicescroll release 3.7.2 | ||
https://nicescroll.areaaperta.com/ | ||
https://github.com/inuyaksa/jquery.nicescroll | ||
|
||
|
||
|
||
Fixes | ||
- support for Apple magic mouse swipe back/forward aka Enable only if needed #378 | ||
- wrapper don't works on relative selector aka same classes not working #635 | ||
- horizontal scrollbar visibible but no need it on responsive layout | ||
- tabindex start counter fix | ||
- setAnimationFrame for IE8 | ||
- touch interaction with multiple scrollareas with IE/Edge on Surface | ||
- mousewheel not working in safari & click event trigger twice in mobile #669 | ||
- false retriggering of scrollend event | ||
- Not scrolling on lastest Firefox with HTML5 inside iframe #322 | ||
|
||
New options | ||
- scrollbarid, you can set id assigned to scrollbar (default: false = auto-assigned) | ||
|
||
Changes | ||
- some code optimizations inspired from #604 by dmadan86 (thank you so much!) | ||
- better content area size detection | ||
- remove support for Windows Phone 7 and 7.1 (mango) | ||
- minimal support change to IE8 | ||
|
||
New script iframe helper | ||
Needed to fix, in some situation, browsers bad implementation of iframe events. (#322) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* iframe script helper for jquery.nicescroll | ||
-- version 0.9.0 | ||
-- copyright 2017-06-18 InuYaksa*2017 | ||
-- licensed under the MIT | ||
-- | ||
-- https://nicescroll.areaaperta.com/ | ||
-- https://github.com/inuyaksa/jquery.nicescroll | ||
-- | ||
*/ | ||
|
||
(function (document,window) { | ||
|
||
var body = document.body; | ||
var parent = window.parent; | ||
|
||
if (parent && ("createEvent" in document)) { | ||
|
||
var isoldie = ("documentMode" in document); // 11- | ||
var ismsedge = ("msCredentials" in window); // MS Edge 14+ | ||
|
||
function onwheel(e) { | ||
|
||
var evt = document.createEvent("MouseEvents"); | ||
evt.initEvent('wheel', true, true); | ||
evt.deltaMode = e.deltaMode; | ||
evt.deltaX = e.deltaX; | ||
evt.deltaY = e.deltaY; | ||
evt.deltaZ = e.deltaZ; | ||
evt.wheelDelta = e.wheelDelta; | ||
evt.wheelDeltaX = e.wheelDeltaX; | ||
evt.wheelDeltaY = e.wheelDeltaY; | ||
|
||
parent.dispatchEvent(evt); | ||
} | ||
|
||
body.addEventListener("wheel", onwheel); | ||
|
||
} | ||
|
||
if (window.addEventListener) { | ||
|
||
// https://davidwalsh.name/add-rules-stylesheets | ||
var sheet = (function () { | ||
var style = document.createElement("style"); | ||
style.appendChild(document.createTextNode("")); | ||
document.head.appendChild(style); | ||
return style.sheet; | ||
})(); | ||
|
||
var tmrscroll = false; | ||
var lastiframe = null; | ||
var lastiframeviewport = null; | ||
var lastscroll = []; | ||
|
||
window.addEventListener("scroll", function (e) { | ||
if (lastiframeviewport) { | ||
// var df = [ window.scrollX - lastscroll[0], window.scrollY - lastscroll[1] ]; | ||
window.scrollTo(lastscroll[0], lastscroll[1]); | ||
// lastiframeviewport.scrollBy(df[0],df[1]); | ||
// console.log(df); | ||
} | ||
}); | ||
|
||
function findNiceParent(t) { | ||
do { | ||
if ($.data(t, '__nicescroll') !== undefined) return t; | ||
t = t.parentNode || false; | ||
} while (t); | ||
return false; | ||
} | ||
|
||
window.addEventListener("load", function () { | ||
|
||
var hasstyle = false; | ||
|
||
$.nicescroll.each(function () { | ||
var nice = this; | ||
nice.scrollstart(function () { | ||
console.log("start"); | ||
if (!hasstyle) sheet.insertRule("iframe { pointer-events: none !important; }", 0); | ||
hasstyle = true; | ||
}); | ||
nice.scrollend(function () { | ||
console.log("end"); | ||
if (hasstyle) sheet.deleteRule(0); | ||
hasstyle = false; | ||
}); | ||
}); | ||
|
||
$("iframe").each(function () { | ||
this.addEventListener("mouseenter", function (e) { | ||
lastiframe = e.target; | ||
var chk = findNiceParent(lastiframe); | ||
lastiframeviewport = chk; | ||
//if (chk) lastiframeviewport = $(chk).getNiceScroll(); | ||
lastscroll = [window.scrollX, window.scrollY]; | ||
}); | ||
this.addEventListener("mouseleave", function (e) { | ||
lastiframe = lastiframeviewport = null; | ||
}); | ||
}); | ||
|
||
}); | ||
|
||
} | ||
|
||
})(document,window); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.