Sha256: 1bc00c26f025a6a35d1113999b2f7d6288099a87aab80ebeb2c6bef325d1ca85

Contents?: true

Size: 1.14 KB

Versions: 64

Compression:

Stored size: 1.14 KB

Contents

pageflow.EditChapterView = Backbone.Marionette.Layout.extend({
  template: 'templates/edit_chapter',
  className: 'edit_chapter',

  mixins: [pageflow.failureIndicatingView],

  regions: {
    formContainer: '.form_container'
  },

  events: {
    'click a.back': 'goBack',
    'click a.destroy': 'destroy'
  },

  onRender: function() {
    var configurationEditor = new pageflow.ConfigurationEditorView({
      model: this.model.configuration
    });

    this.configure(configurationEditor);
    this.formContainer.show(configurationEditor);
  },

  configure: function(configurationEditor) {
    var view = this;

    configurationEditor.tab('general', function() {
      this.input('title', pageflow.TextInputView, {
        model: view.model
      });

      if (pageflow.features.isEnabled('chapter_hierachy')) {
        this.input('display_parent_page_button', pageflow.CheckBoxInputView);
      }
    });
  },

  destroy: function() {
    if (confirm(I18n.t('pageflow.editor.views.edit_chapter_view.confirm_destroy'))) {
      this.model.destroy();
      this.goBack();
    }
  },

  goBack: function() {
    editor.navigate('/', {trigger: true});
  }
});

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
pageflow-14.5.2 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-15.0.2 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-15.0.1 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-15.0.0 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-14.5.1 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-14.5.0 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-15.0.0.rc2 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-15.0.0.rc1 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-15.0.0.beta4 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-15.0.0.beta3 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-14.4.0 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-15.0.0.beta2 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-15.0.0.beta1 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-14.3.0 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-14.2.1 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-14.2.0 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-14.1.1 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-14.1.0 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-14.0.0 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js
pageflow-14.0.0.rc2 app/assets/javascripts/pageflow/editor/views/edit_chapter_view.js