1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 23:32:40 +01:00
phorge-phorge/webroot/rsrc/js/application/diffusion/behavior-jump-to.js
epriestley 7ed4bb4f17 Fix scrolling behavior in Diffusion
Summary: Fixes T7084. This doesn't use the same anchor logic as other applications.

Test Plan: `$245` lines now jump to line 245 on page load.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T7084

Differential Revision: https://secure.phabricator.com/D11563
2015-01-29 10:20:35 -08:00

15 lines
341 B
JavaScript

/**
* @provides javelin-behavior-diffusion-jump-to
* @requires javelin-behavior
* javelin-vector
* javelin-dom
*/
JX.behavior('diffusion-jump-to', function(config) {
setTimeout(function() {
var pos = JX.Vector.getPosWithScroll(JX.$(config.target));
JX.DOM.scrollToPosition(0, pos.y - 100);
}, 0);
});