MCPcopy
hub / github.com/Semantic-Org/Semantic-UI / setupPublicMethods

Function setupPublicMethods

examples/assets/library/iframe-content.js:482–560  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

480 }
481
482 function setupPublicMethods() {
483 log('Enable public methods');
484
485 win.parentIFrame = {
486
487 autoResize: function autoResizeF(resize) {
488 if (true === resize && false === autoResize) {
489 autoResize=true;
490 startEventListeners();
491 //sendSize('autoResize','Auto Resize enabled');
492 } else if (false === resize && true === autoResize) {
493 autoResize=false;
494 stopEventListeners();
495 }
496
497 return autoResize;
498 },
499
500 close: function closeF() {
501 sendMsg(0,0,'close');
502 teardown();
503 },
504
505 getId: function getIdF() {
506 return myID;
507 },
508
509 getPageInfo: function getPageInfoF(callback) {
510 if ('function' === typeof callback) {
511 pageInfoCallback = callback;
512 sendMsg(0,0,'pageInfo');
513 } else {
514 pageInfoCallback = function() {};
515 sendMsg(0,0,'pageInfoStop');
516 }
517 },
518
519 moveToAnchor: function moveToAnchorF(hash) {
520 inPageLinks.findTarget(hash);
521 },
522
523 reset: function resetF() {
524 resetIFrame('parentIFrame.reset');
525 },
526
527 scrollTo: function scrollToF(x,y) {
528 sendMsg(y,x,'scrollTo'); // X&Y reversed at sendMsg uses height/width
529 },
530
531 scrollToOffset: function scrollToF(x,y) {
532 sendMsg(y,x,'scrollToOffset'); // X&Y reversed at sendMsg uses height/width
533 },
534
535 sendMessage: function sendMessageF(msg,targetOrigin) {
536 sendMsg(0,0,'message',JSON.stringify(msg),targetOrigin);
537 },
538
539 setHeightCalculationMethod: function setHeightCalculationMethodF(heightCalculationMethod) {

Callers 1

initFunction · 0.85

Calls 9

startEventListenersFunction · 0.85
stopEventListenersFunction · 0.85
sendMsgFunction · 0.85
teardownFunction · 0.85
checkHeightModeFunction · 0.85
checkWidthModeFunction · 0.85
sendSizeFunction · 0.85
logFunction · 0.70
resetIFrameFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…