github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/website/source/assets/javascripts/app/Init.js (about)

     1  (function(Sidebar, CubeDraw){
     2  
     3  // Quick and dirty IE detection
     4  var isIE = (function(){
     5  	if (window.navigator.userAgent.match('Trident')) {
     6  		return true;
     7  	} else {
     8  		return false;
     9  	}
    10  })();
    11  
    12  // isIE = true;
    13  
    14  var Init = {
    15  
    16  	start: function(){
    17  		var id = document.body.id.toLowerCase();
    18  
    19  		if (this.Pages[id]) {
    20  			this.Pages[id]();
    21  		}
    22  
    23  		//always init sidebar
    24  		Init.initializeSidebar();
    25  	},
    26  
    27  	initializeSidebar: function(){
    28  		new Sidebar();
    29  	},
    30  
    31  	initializeHomepage: function(){
    32  		$('#use-case-nav a').click(function (e) {
    33  		  e.preventDefault()
    34  			console.log($(this)[0])
    35  			console.log($(this).tab())
    36  		  $(this).tab('show')
    37  		})
    38  
    39  		$('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
    40  		  console.log('show new active tab', e.target) // newly activated tab
    41  		  console.log(e.relatedTarget);
    42  		})
    43  	},
    44  
    45  	Pages: {
    46  		'page-home': function(){
    47  			Init.initializeHomepage();
    48  		}
    49  	}
    50  
    51  };
    52  
    53  Init.start();
    54  
    55  })(window.Sidebar, window.CubeDraw);