mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 03:35:25 +08:00
Update RTE for step description [SCI-3111]
This commit is contained in:
parent
7db53fad7c
commit
eb3d1ea6fe
3 changed files with 11 additions and 5 deletions
|
@ -150,7 +150,7 @@
|
|||
animateSpinner(null, false);
|
||||
initPreviewModal();
|
||||
DragNDropSteps.clearFiles();
|
||||
TinyMCE.refresh();
|
||||
TinyMCE.init('#step_description_textarea');
|
||||
$("#new-step-checklists fieldset.nested_step_checklists ul").each(function () {
|
||||
enableCheckboxSorting(this);
|
||||
});
|
||||
|
@ -253,7 +253,6 @@
|
|||
initEditableHandsOnTable($form);
|
||||
applyCancelCallBack();
|
||||
|
||||
TinyMCE.refresh();
|
||||
SmartAnnotation.preventPropagation('.atwho-user-popover');
|
||||
|
||||
//Rerender tables
|
||||
|
@ -513,7 +512,7 @@
|
|||
$('#step_name').focus();
|
||||
});
|
||||
|
||||
TinyMCE.refresh();
|
||||
TinyMCE.init('#step_description_textarea');
|
||||
});
|
||||
|
||||
},
|
||||
|
|
2
app/assets/javascripts/sitewide/tiny_mce.js
vendored
2
app/assets/javascripts/sitewide/tiny_mce.js
vendored
|
@ -184,7 +184,7 @@ var TinyMCE = (function() {
|
|||
destroyAll: function() {
|
||||
_.each(tinyMCE.editors, function(editor) {
|
||||
if (editor) {
|
||||
editor.destroy();
|
||||
editor.remove();
|
||||
initHighlightjs();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -29,7 +29,14 @@
|
|||
<div class="tab-pane active" role="tabpanel" id="new-step-main">
|
||||
<%= f.text_field :name, label: t("protocols.steps.new.name"), placeholder: t("protocols.steps.new.name_placeholder") %>
|
||||
<div class="form-group">
|
||||
<%= f.tiny_mce_editor(:description, data: { object_type: 'step', object_id: @step.id }) %>
|
||||
<%= f.tiny_mce_editor(:description,
|
||||
id: :step_description_textarea,
|
||||
hide_label: false,
|
||||
value: sanitize_input(@step.description),
|
||||
data: {
|
||||
object_type: 'step',
|
||||
object_id: @step.id,
|
||||
highlightjs_path: asset_path('highlightjs-github-theme') } ) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" role="tabpanel" id="new-step-checklists">
|
||||
|
|
Loading…
Reference in a new issue