Skip to content
Code-Schnipsel Gruppen Projekte
Commit 2087bff4 erstellt von Jan Wennrich's avatar Jan Wennrich
Dateien durchsuchen

feat: ContentSwitcher parses media-input-control on entry added (#73)

Übergeordneter abb4cdc3
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
/** /**
* *
* @module package/quiqqer/bricks/bin/Controls/ContentSwitcher * @module package/quiqqer/bricks/bin/Controls/ContentSwitcher
...@@ -10,47 +9,69 @@ define('package/quiqqer/bricks/bin/Controls/ContentSwitcher', [ ...@@ -10,47 +9,69 @@ define('package/quiqqer/bricks/bin/Controls/ContentSwitcher', [
'qui/controls/elements/FormList', 'qui/controls/elements/FormList',
'utils/Controls',
'Locale', 'Locale',
'css!package/quiqqer/bricks/bin/Controls/ContentSwitcher.css' 'css!package/quiqqer/bricks/bin/Controls/ContentSwitcher.css'
], function (QUIFormList, QUILocale) { ], function (QUIFormList, QUIControls, QUILocale) {
"use strict"; "use strict";
var lg = 'quiqqer/bricks'; var lg = 'quiqqer/bricks';
return new Class({ return new Class({
Extends : QUIFormList, Extends: QUIFormList,
Type : 'package/quiqqer/bricks/bin/Controls/ContentSwitcher', Type : 'package/quiqqer/bricks/bin/Controls/ContentSwitcher',
initialize : function (options) { initialize: function (options) {
this.parent(options); this.parent(options);
this.addEvents({
parsed: this.onParsed
});
this.setAttribute( this.setAttribute(
'entry', 'entry',
'<div class="quiqqer-bricks-ContentSwitcher-entry">' + '<div class="quiqqer-bricks-ContentSwitcher-entry" style="display: none;">' +
'<label>' + '<label class="entry-image">' +
'<span class="entry-title">'+ '<span class="entry-title">' +
QUILocale.get(lg, 'contentSwitcher.entries.entry.picture') + QUILocale.get(lg, 'contentSwitcher.entries.entry.picture') +
'</span>' + '</span>' +
'<input type="text" class="media-image" name="img" />' + '<input class="media-image" data-qui-options-selectable_types="image" name="img"/>' +
'</label>' + '</label>' +
'<label>' + '<label>' +
'<span class="entry-title">'+ '<span class="entry-title">' +
QUILocale.get(lg, 'contentSwitcher.entries.entry.title') + QUILocale.get(lg, 'contentSwitcher.entries.entry.title') +
'</span>' + '</span>' +
'<input type="text" name="title" />' + '<input type="text" name="title" />' +
'</label>' + '</label>' +
'<label>' + '<label>' +
'<span class="entry-title">'+ '<span class="entry-title">' +
QUILocale.get(lg, 'contentSwitcher.entries.entry.content') + QUILocale.get(lg, 'contentSwitcher.entries.entry.content') +
'</span>' + '</span>' +
'<textarea name="content" rows="10"></textarea>' + '<textarea name="content" rows="10"></textarea>' +
'</label>' + '</label>' +
'</div>' '</div>'
); );
},
/**
* Parses QUI controls when a new entry is created
*
* Fired after (inherited) FormList has parsed the content
*
* @param event
* @param Element - The element that was previously parsed by (inherited) FormList
*/
onParsed: function (event, Element) {
QUIControls.parse(Element).then(function () {
// Element is fully parsed so we can finally show it
Element.getElement('.quiqqer-bricks-ContentSwitcher-entry').show();
});
} }
}); });
}); });
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren