Sha256: c4cbe34d64682d97e4aa77a9805b3596426b5b0860a1715f0b403a89c62d78f4

Contents?: true

Size: 1.06 KB

Versions: 16

Compression:

Stored size: 1.06 KB

Contents

pageflow.EditPageLinkView = Backbone.Marionette.Layout.extend({
  template: 'pageflow/editor/templates/edit_page_link',

  regions: {
    formContainer: '.form_container'
  },

  ui: {
    backButton: 'a.back'
  },

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

    'click a.destroy': 'destroy'
  },

  onRender: function() {
    var pageType = this.options.api.pageTypes.findByPage(this.options.page);
    var configurationEditor = pageType.createPageLinkConfigurationEditorView({
      model: this.model,
      page: this.options.page
    });

    this.formContainer.show(configurationEditor);

    this.highlight();
  },

  highlight: function() {
    this.model.highlight();

    this.listenTo(this, 'close', function() {
      this.model.resetHighlight();
    });
  },

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

  goBack: function() {
    pageflow.editor.navigate('/pages/' + this.options.page.id + '/links', {trigger: true});
  }
});

Version data entries

16 entries across 16 versions & 1 rubygems

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