diff --git a/entry_types/scrolled/config/locales/new/backdrop-position.de.yml b/entry_types/scrolled/config/locales/new/backdrop-position.de.yml index 0e264ce87..071cd6705 100644 --- a/entry_types/scrolled/config/locales/new/backdrop-position.de.yml +++ b/entry_types/scrolled/config/locales/new/backdrop-position.de.yml @@ -1,4 +1,7 @@ de: + pageflow: + backdrop_content_elements: + feature_name: "Inhaltselemente als Backdrop" pageflow_scrolled: editor: common_content_element_attributes: diff --git a/entry_types/scrolled/config/locales/new/backdrop-position.en.yml b/entry_types/scrolled/config/locales/new/backdrop-position.en.yml index c1ee75f90..abd02dbe7 100644 --- a/entry_types/scrolled/config/locales/new/backdrop-position.en.yml +++ b/entry_types/scrolled/config/locales/new/backdrop-position.en.yml @@ -1,4 +1,7 @@ en: + pageflow: + backdrop_content_elements: + feature_name: "Backdrop content elements" pageflow_scrolled: editor: common_content_element_attributes: diff --git a/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb b/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb index 41c2f3956..91d1640e0 100644 --- a/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb +++ b/entry_types/scrolled/lib/pageflow_scrolled/plugin.rb @@ -38,6 +38,7 @@ def configure(config) c.features.register('image_gallery_content_element') c.features.register('frontend_v2') c.features.register('scrolled_entry_fragment_caching') + c.features.register('backdrop_content_elements') c.additional_frontend_seed_data.register( 'frontendVersion', diff --git a/entry_types/scrolled/package/spec/editor/models/ContentElement-spec.js b/entry_types/scrolled/package/spec/editor/models/ContentElement-spec.js index 638404ebf..b2f5ef45c 100644 --- a/entry_types/scrolled/package/spec/editor/models/ContentElement-spec.js +++ b/entry_types/scrolled/package/spec/editor/models/ContentElement-spec.js @@ -1,10 +1,13 @@ import {editor} from 'pageflow-scrolled/editor'; import {ScrolledEntry} from 'editor/models/ScrolledEntry'; import {factories, normalizeSeed} from 'support'; +import {features} from 'pageflow/frontend'; describe('ContentElement', () => { describe('getAvailablePositions', () => { beforeEach(() => { + features.enable('frontend', ['backdrop_content_elements']); + editor.contentElementTypes.register('inlineImage', {}); editor.contentElementTypes.register('soundDisclaimer', {supportedPositions: ['inline']}); }); diff --git a/entry_types/scrolled/package/src/editor/models/ContentElement.js b/entry_types/scrolled/package/src/editor/models/ContentElement.js index af2f96948..5c8f4bc06 100644 --- a/entry_types/scrolled/package/src/editor/models/ContentElement.js +++ b/entry_types/scrolled/package/src/editor/models/ContentElement.js @@ -8,6 +8,7 @@ import { delayedDestroying } from 'pageflow/editor'; +import {features} from 'pageflow/frontend'; import {ContentElementConfiguration} from './ContentElementConfiguration'; const widths = { @@ -97,10 +98,11 @@ export const ContentElement = Backbone.Model.extend({ getAvailablePositions() { const layout = this.section.configuration.get('layout'); + const backdrop = features.isEnabled('backdrop_content_elements') ? 'backdrop' : null; const supportedByLayout = layout === 'center' || layout === 'centerRagged' ? - ['inline', 'left', 'right', 'standAlone', 'backdrop'] : - ['inline', 'sticky', 'standAlone', 'backdrop']; + ['inline', 'left', 'right', 'standAlone', backdrop] : + ['inline', 'sticky', 'standAlone', backdrop]; const supportedByType = this.getType().supportedPositions; if (supportedByType) { diff --git a/entry_types/scrolled/package/src/editor/views/EditSectionView.js b/entry_types/scrolled/package/src/editor/views/EditSectionView.js index 8224c3e76..91635bb0c 100644 --- a/entry_types/scrolled/package/src/editor/views/EditSectionView.js +++ b/entry_types/scrolled/package/src/editor/views/EditSectionView.js @@ -9,6 +9,7 @@ import {BackdropContentElementInputView} from './inputs/BackdropContentElementIn import {EffectListInputView} from './inputs/EffectListInputView'; import {InlineFileRightsMenuItem} from '../models/InlineFileRightsMenuItem' import I18n from 'i18n-js'; +import {features} from 'pageflow/frontend'; import {EditMotifAreaDialogView} from './EditMotifAreaDialogView'; @@ -34,7 +35,9 @@ export const EditSectionView = EditConfigurationView.extend({ configurationEditor.tab('section', function() { this.input('backdropType', SelectInputView, { - values: ['image', 'video', 'color', 'contentElement'], + values: features.isEnabled('backdrop_content_elements') ? + ['image', 'video', 'color', 'contentElement'] : + ['image', 'video', 'color'], }); this.input('fullHeight', CheckBoxInputView, {