main.js 478 B

12345678910111213141516171819
  1. var MainView = BaseView.extend({
  2. el: '#app',
  3. templateUrl: '/options/templates/main.html',
  4. tabs: {
  5. '': MainTab,
  6. settings: SettingsTab,
  7. about: AboutTab,
  8. },
  9. initialize: function (tab) {
  10. var _this = this;
  11. _this.tab = _this.tabs[tab] || _this.tabs[''];
  12. BaseView.prototype.initialize.call(_this);
  13. },
  14. render: function () {
  15. this.$el.html(this.templateFn({tab: this.tab.prototype.name}));
  16. this.view = new this.tab;
  17. return this;
  18. },
  19. });