Sha256: 730604282c8a344bbdf1ad508f494fd3d8ff05806f67e781e587521cc1099492

Contents?: true

Size: 1.55 KB

Versions: 2

Compression:

Stored size: 1.55 KB

Contents

pageflow.SidebarController = Backbone.Marionette.Controller.extend({
  initialize: function(options) {
    this.region = options.region;
    this.entry = options.entry;
  },

  index: function() {
    this.region.show(new pageflow.EditEntryView({
      model: this.entry
    }));
  },

  imageFiles: function(pageId, attributeName) {
    this.files(pageId, attributeName, 'image_files');
  },

  videoFiles: function(pageId, attributeName) {
    this.files(pageId, attributeName, 'video_files');
  },

  audioFiles: function(pageId, attributeName) {
    this.files(pageId, attributeName, 'audio_files');
  },

  files: function(pageId, attributeName, tabName) {
    this.region.show(new pageflow.FilesView({
      model: this.entry,
      page: this.entry.pages.get(pageId),
      pageAttributeName: attributeName,
      tabName: tabName
    }));
  },

  confirmableFiles: function() {
    this.region.show(pageflow.ConfirmEncodingView.create({
      model: new pageflow.EncodingConfirmation()
    }));
  },

  metaData: function() {
    this.region.show(new pageflow.EditMetaDataView({
      model: this.entry
    }));
  },

  publish: function() {
    this.region.show(pageflow.PublishEntryView.create({
      model: this.entry,
      entryPublication: new pageflow.EntryPublication()
    }));
  },

  chapter: function(id) {
    this.region.show(new pageflow.EditChapterView({
      model: this.entry.chapters.get(id)
    }));
  },

  page: function(id, tab) {
    this.region.show(new pageflow.EditPageView({
      model: this.entry.pages.get(id),
      tab: tab
    }));
  }
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pageflow-0.2.1 app/assets/javascripts/pageflow/editor/controllers/sidebar_controller.js
pageflow-0.2.0 app/assets/javascripts/pageflow/editor/controllers/sidebar_controller.js