MCPcopy Index your code
hub / github.com/Semantic-Org/Semantic-UI / findTarget

Function findTarget

examples/assets/library/iframe.js:393–427  ·  view source on GitHub ↗
(location)

Source from the content-addressed store, hash-verified

391 }
392
393 function findTarget(location) {
394 function jumpToTarget() {
395 var jumpPosition = getElementPosition(target);
396
397 log(iframeId,'Moving to in page link (#'+hash+') at x: '+jumpPosition.x+' y: '+jumpPosition.y);
398 pagePosition = {
399 x: jumpPosition.x,
400 y: jumpPosition.y
401 };
402
403 scrollTo();
404 log(iframeId,'--');
405 }
406
407 function jumpToParent() {
408 if (window.parentIFrame) {
409 window.parentIFrame.moveToAnchor(hash);
410 } else {
411 log(iframeId,'In page link #'+hash+' not found and window.parentIFrame not found');
412 }
413 }
414
415 var
416 hash = location.split('#')[1] || '',
417 hashData = decodeURIComponent(hash),
418 target = document.getElementById(hashData) || document.getElementsByName(hashData)[0];
419
420 if (target) {
421 jumpToTarget();
422 } else if(window.top!==window.self) {
423 jumpToParent();
424 } else {
425 log(iframeId,'In page link #'+hash+' not found');
426 }
427 }
428
429 function callback(funcName,val) {
430 return chkCallback(iframeId,funcName,val);

Callers 1

actionMsgFunction · 0.70

Calls 3

jumpToParentFunction · 0.85
jumpToTargetFunction · 0.70
logFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…