Sha256: fb3e1d0695ddad0f1819c7d70faeb97de86abccf2032e7ce02cfc3ce48397017

Contents?: true

Size: 1.16 KB

Versions: 7

Compression:

Stored size: 1.16 KB

Contents

pageflow.sitemap.SelectionModeController = pageflow.sitemap.AbstractController.extend({
  name: 'selection_mode',

  initialize: function(entry, options) {
    this.entry = entry;
    this.options = options || {};
  },

  pageSelected: function (page) {
    this.trigger('selected', page);
  },

  addDebouncedUpdateHandler: function (handler) {
    var fragmentParser = new pageflow.sitemap.FragmentParser(this.entry, Backbone.history.fragment);
    var options = this.options;

    var session = {
      entry: this.entry,
      selection: new pageflow.sitemap.Selection(),
      isPageDisabled: function(page) {
        return options.isAllowed && !options.isAllowed(page);
      },
      highlightedPage: this.options.noHighlight ? null : fragmentParser.getModel('pages'),
      highlightedStoryline: this.options.noHighlight ? null : fragmentParser.getModel('storylines')
    };

    handler(session);

    this.listenTo(this.entry.chapters, 'add remove destroying change:configuration', function() {
      handler(session);
    });

    this.listenTo(this.entry.pages, 'add remove destroying destroy change change:configuration', function() {
      handler(session);
    });
  }
});

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pageflow-sitemap-1.5.0 app/assets/javascripts/pageflow/sitemap/editor/controllers/selection_mode_controller.js
pageflow-sitemap-1.4.0 app/assets/javascripts/pageflow/sitemap/editor/controllers/selection_mode_controller.js
pageflow-sitemap-1.3.0 app/assets/javascripts/pageflow/sitemap/editor/controllers/selection_mode_controller.js
pageflow-sitemap-1.2.0 app/assets/javascripts/pageflow/sitemap/editor/controllers/selection_mode_controller.js
pageflow-sitemap-1.1.0 app/assets/javascripts/pageflow/sitemap/editor/controllers/selection_mode_controller.js
pageflow-sitemap-1.0.0 app/assets/javascripts/pageflow/sitemap/editor/controllers/selection_mode_controller.js
pageflow-sitemap-0.1.0 app/assets/javascripts/pageflow/sitemap/editor/controllers/selection_mode_controller.js