backports murph-skeleton
This commit is contained in:
parent
f5bd7d10c5
commit
590e9ae679
|
@ -1,5 +1,6 @@
|
|||
const $ = require('jquery')
|
||||
|
||||
if (typeof tinymce !== 'undefined') {
|
||||
tinymce.murph = tinymce.murph || {}
|
||||
tinymce.murph.selector = tinymce.murph.selector || '*[data-tinymce]'
|
||||
tinymce.murph.configurationBase = tinymce.murph.configurationBase || {
|
||||
|
@ -38,6 +39,7 @@ tinymce.murph.modes.light = tinymce.murph.modes.light || {
|
|||
quickbars_selection_toolbar: 'bold italic',
|
||||
toolbar: 'undo redo | bold italic underline',
|
||||
}
|
||||
}
|
||||
|
||||
const buildConfiguration = (conf) => {
|
||||
return Object.assign({}, tinymce.murph.configurationBase, conf);
|
||||
|
@ -81,8 +83,6 @@ const doInitEditor = () => {
|
|||
conf.mode = 'exact'
|
||||
conf.elements = id
|
||||
|
||||
console.log(conf);
|
||||
|
||||
tinymce.init(conf);
|
||||
})
|
||||
}
|
||||
|
@ -96,5 +96,5 @@ module.exports = function() {
|
|||
const config = {attributes: false, childList: true, subtree: true};
|
||||
observer.observe(document.querySelector('body'), config);
|
||||
|
||||
doInitEditor();
|
||||
$(window).ready(doInitEditor);
|
||||
};
|
||||
|
|
|
@ -112,3 +112,29 @@
|
|||
</div>
|
||||
</template>
|
||||
{% endblock %}
|
||||
|
||||
{% block form_row -%}
|
||||
{%- set widget_attr = {} -%}
|
||||
|
||||
{%- if help is not empty -%}
|
||||
{%- set widget_attr = {attr: {'aria-describedby': id ~ "_help"}} -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if compound is defined and compound -%}
|
||||
{%- set element = 'fieldset' -%}
|
||||
{% else %}
|
||||
{%- set element = 'div' -%}
|
||||
{%- endif -%}
|
||||
|
||||
{% if element == 'fieldset' and not ('col-' in form.vars.row_attr.class|default('')) %}
|
||||
{% set class = row_attr.class|default('') ~ ' col-md-12 form-group' %}
|
||||
{% else %}
|
||||
{% set class = row_attr.class|default('') ~ ' form-group' %}
|
||||
{% endif %}
|
||||
|
||||
<{{ element }}{% with {attr: row_attr|merge({class: class|trim})} %}{{ block('attributes') }}{% endwith %}>
|
||||
{{- form_label(form) -}}
|
||||
{{- form_widget(form) -}}
|
||||
{{- form_help(form) -}}
|
||||
</{{ element|default('div') }}>
|
||||
{%- endblock form_row %}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-8 p-2">
|
||||
{{ form_widget(form) }}
|
||||
{{ form_widget(form, {attr: {class: 'row'}}) }}
|
||||
</div>
|
||||
<div class="col-md-4 p-3">
|
||||
<ul class="nav nav-pills">
|
||||
|
|
Loading…
Reference in a new issue