Sha256: b158b863575e754c4b54e2c4022122b6262b85da39c27f1c7c90dbf007767e1d
Contents?: true
Size: 1.43 KB
Versions: 1
Compression:
Stored size: 1.43 KB
Contents
var CabooseStation = function(m) { this.modal = m; this.init(); }; CabooseStation.prototype = { modal: false, init: function() { var this2 = this; // Handle main nav items with subnav $('#station > ul > li > a').click(function(event) { li = $(this).parent(); if ($('ul', li).length > 0) { event.preventDefault(); id = li.attr('id').replace('nav_item_', ''); href = $(this).attr('href'); this2.subnav(id, href); } else if ($(this).attr('rel') != 'modal') { event.preventDefault(); parent.window.location = $(this).attr('href'); } }); $('#station ul li ul li a').click(function(event) { if ($(this).attr('rel') != 'modal') { event.preventDefault(); parent.window.location = $(this).attr('href'); } }); }, subnav: function(id, href) { this.modal.set_width(400); $('#station > ul > li').each(function(i, li) { id2 = $(li).attr('id').replace('nav_item_', ''); if (id == id2) $(li).addClass('selected'); else $(li).removeClass('selected'); }); // Show only the selected subnav $('#station ul li ul').hide(); $('#station ul li#nav_item_' + id + ' ul').show(); // Set the height of the selected subnav var height = $('#station > ul').height(); $('#station ul li#nav_item_' + id + ' ul').height(height); } };
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
caboose-cms-0.2.5 | app/assets/javascripts/caboose/station.js |