Your IP : 3.135.223.175


Current Path : /usr/local/mgr5/skins/orion/src/
Upload File :
Current File : //usr/local/mgr5/skins/orion/src/App.Bands.js

/**
 * App.Bands module
 * Scroll to Ancor in report table
 *  @param {object} window  global object
 *  @param {function} $ jQuery library
 *  @param {object} EventMgr EventMgr library
 *  @param {object} App Application
 */
App.Bands = function(window, $, EventMgr, App) {
  'use strict';
  function init() {
    EventMgr.on($content(), bandAncorLinkSelector, 'click', scrollToAncor);
  }

  function $content() {
    return $('#content');
  }

  var bandAncorLinkSelector = 'span[data-child-id]';

  function scrollToAncor(e) {
    var chilid = this.getAttribute('data-child-id'),
      topHim = $('#' + chilid).offset().top,
      tabId = $('.tab-content_st_active').attr('data-tabid'),
      topTabCont = $('#form-scroll-' + tabId).offset().top,
      tabCont = App.Dom.byId('form-scroll-' + tabId),
      scrollTop;
    if (tabCont === null) {return;}
//tabCont.scrollTop =  tabCont.scrollTop + (topHim - topTabCont);
    scrollTop = tabCont.scrollTop + (topHim - topTabCont);
    ScrollHandler.scrollTo('form-scroll-' + tabId, scrollTop, false, true);
//ScrollHandler.forceMove('form-scroll-' + tabId);
  }

  return {
    init: init
  };
}(window, $, EventMgr, App);