// Once generated by CoffeeScript 1.9.3, but now lives as pure JS /* eslint-disable */ // TODO: Examine all of the xss-lint exceptions (https://openedx.atlassian.net/browse/PLAT-2084) (function() { var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; this.Tab = (function() { function Tab(id1, items) { this.id = id1; this.items = items; this.onShow = bind(this.onShow, this); this.el = $("#tab_" + id); this.render(); } Tab.prototype.$ = function(selector) { return $(selector, this.el); }; Tab.prototype.render = function() { $.each(this.items, (function(_this) { return function(index, item) { var tab; tab = $('').attr({ href: "#" + (_this.tabId(index)) }).html(item.title); // xss-lint: disable=javascript-jquery-html _this.$('.navigation').append($('
  • ').append(tab)); // xss-lint: disable=javascript-jquery-append return _this.el.append($('
    ').attr({ id: _this.tabId(index) })); }; })(this)); return this.el.tabs({ show: this.onShow }); }; Tab.prototype.onShow = function(element, ui) { this.$('section.ui-tabs-hide').html(''); this.$("#" + (this.tabId(ui.index))).html(this.items[ui.index]['content']); // xss-lint: disable=javascript-jquery-html return this.el.trigger('contentChanged'); }; Tab.prototype.tabId = function(index) { return "tab-" + this.id + "-" + index; }; return Tab; })(); }).call(this);