1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-21 09:48:47 +02:00
phorge-phorge/webroot/rsrc/js/application/diffusion/behavior-jump-to.js
epriestley ea67a8ab8e Make scrolling happen relative to the main content frame
Summary: Fixes T7033. When we've reframed the main page content we need to scroll relative to the containing frame, not relative to the window.

Test Plan:
In Safari, Chrome and Firefox, used j/k/J/K keys to navigate diff content.

Tried some other scroll-based beahviors, like jump-to-anchors.

(It looks like the highlighting reticle got slightly derped a while ago, but it's still functional, so I didn't mess with it.)

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T7033

Differential Revision: https://secure.phabricator.com/D11490
2015-01-25 08:42:40 -08:00

14 lines
293 B
JavaScript

/**
* @provides javelin-behavior-diffusion-jump-to
* @requires javelin-behavior
* javelin-vector
* javelin-dom
*/
JX.behavior('diffusion-jump-to', function(config) {
setTimeout(function() {
JX.DOM.scrollTo(0, JX.$V(JX.$(config.target)).y - 100);
}, 0);
});