Sha256: 2af9e15602c273702ca1dd88122dcc884b8ece5aececf1d1e77e648a39fba6fd
Contents?: true
Size: 1.24 KB
Versions: 11
Compression:
Stored size: 1.24 KB
Contents
I"é(function() { App.UI.Tabs = (function() { function Tabs(node, delegator) { this.sel = $(node); this.delegator = delegator; this.handle(); } Tabs.prototype.handle = function() { var elementsSize; elementsSize = this.sel.find('a').size(); return this.sel.find('a').click((function(_this) { return function(e) { var child, i, index, left, len, ref, width; e.preventDefault(); if ($(e.target).hasClass("active")) { return; } index = 0; ref = $(e.target).parent().children('a'); for (i = 0, len = ref.length; i < len; i++) { child = ref[i]; if ($(child).text() === $(e.target).text()) { break; } index += 1; } width = parseInt(_this.sel.css('width')); left = width / elementsSize * index; _this.sel.find('a.active').removeClass('active'); $(e.target).addClass('active'); _this.sel.find('div.background').velocity({ left: left }, 200); return _this.delegator[$(e.target).data("action")](); }; })(this)); }; return Tabs; })(); }).call(this); :ET
Version data entries
11 entries across 4 versions & 1 rubygems