Sha256: 3da25ac0d9432f5422236be520d5e2d132f863ee6ec6d963db41ec5369b30dde

Contents?: true

Size: 1.18 KB

Versions: 11

Compression:

Stored size: 1.18 KB

Contents

pageflow.ConfigurationEditorView = Backbone.Marionette.View.extend({
  className: 'configuration_editor',

  initialize: function() {
    this.tabsView = new pageflow.TabsView({
      i18n: 'editor.configuration_editor.tabs',
      defaultTab: this.options.tab
    });
    this.configure();
  },

  configure: function() {},

  tab: function(name, callback) {
    this.tabsView.tab(name, _.bind(function() {
      var tabView = new pageflow.ConfigurationEditorTabView({
        model: this.model
      });

      callback.call(tabView);
      return tabView;
    }, this));
  },

  render: function() {
    this.$el.append(this.subview(this.tabsView).el);
    return this;
  }
});

_.extend(pageflow.ConfigurationEditorView, {
  repository: {},
  register: function(pageTypeName, prototype) {
    this.repository[pageTypeName] = pageflow.ConfigurationEditorView.extend(prototype);
  },

  create: function(pageTypeName, options) {
    if (!this.repository.hasOwnProperty(pageTypeName)) {
      throw 'No configuration editor registered for page type "' + pageTypeName + '".';
    }

    options.pageType = pageflow.Page.typesByName[pageTypeName];

    return new this.repository[pageTypeName](options);
  }
});

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pageflow-0.5.0 app/assets/javascripts/pageflow/editor/views/configuration_editor_view.js
pageflow-0.4.0 app/assets/javascripts/pageflow/editor/views/configuration_editor_view.js
pageflow-0.3.0 app/assets/javascripts/pageflow/editor/views/configuration_editor_view.js
pageflow-0.2.1 app/assets/javascripts/pageflow/editor/views/configuration_editor_view.js
pageflow-0.2.0 app/assets/javascripts/pageflow/editor/views/configuration_editor_view.js
pageflow-0.1.0 app/assets/javascripts/pageflow/editor/views/configuration_editor_view.js
pageflow-0.0.5 app/assets/javascripts/pageflow/editor/views/configuration_editor_view.js
pageflow-0.0.4 app/assets/javascripts/pageflow/editor/views/configuration_editor_view.js
pageflow-0.0.3 app/assets/javascripts/pageflow/editor/views/configuration_editor_view.js
pageflow-0.0.2 app/assets/javascripts/pageflow/editor/views/configuration_editor_view.js
pageflow-0.0.1 app/assets/javascripts/pageflow/editor/views/configuration_editor_view.js