Issue 1 (duplicate id on the button) This should be editor_template_on template, if file structure was kept.
Issue 2 & 3 (when expand button is clicked it submits post.)
This is a 2 part fix, First the script needs to be taken out of the form section, whether you place at the bottom of the page, or right after the form is up to you.
Then some code needs to be added so it doesnt trigger the submit button when pressed (because even out of the form, it will still trigger the submit)
Code in question (PINK indicating code that needs to be added)
Now we got some function.
With these changes you'll notice the CSS is a little wonky, but these are all easy fixes.
Notes to change:
- Textarea needs the scrollbar on dive mode remove overflow-y: hidden; from inline because the jquery already autosizes the height this is not needed
- the inherit width needs to be removed from .editor-mode-dive textarea
- controlbar-container needs scrollbars removed and height adjusted
- the post button will need to be added to the dive mode.
But I figured someone was stuck somewhere thats why this wasn't fixed, so I thought I'd help. I am a vBulletin developer and I would love to be on the design team!
Code:
<div class="toolbar-group pull-right editor-mode-dive-only">
<button tabindex="-1" class="btn btn-default" title="Exit distraction-free mode." id="[COLOR="Red"]editor-button-[COLOR="PINK"]exit[/COLOR]dive[/COLOR]">
<i class="fa fa-compress"></i>
</button>
</div>
<div class="toolbar-group pull-right editor-mode-dive-hidden">
<button tabindex="-1" class="btn btn-default" title=""Dive" into distraction-free writing mode." id="editor-button-dive">
<i class="fa fa-expand"></i>
</button>
</div>
Issue 2 & 3 (when expand button is clicked it submits post.)
This is a 2 part fix, First the script needs to be taken out of the form section, whether you place at the bottom of the page, or right after the form is up to you.
Then some code needs to be added so it doesnt trigger the submit button when pressed (because even out of the form, it will still trigger the submit)
Code in question (PINK indicating code that needs to be added)
Code:
<script type="text/javascript">
if(autoTextAreaHeight == true) {
$('#{$editorid}_textarea').autoHeight();
}
$('#editor-button-dive').click(function([COLOR="PINK"]e[/COLOR]) {
[COLOR="PINK"]e.preventDefault();[/COLOR]
$("#{$editorid}").addClass("editor-mode-dive");
});
$('#editor-button-exitdive').click(function([COLOR="PINK"]e[/COLOR]) {
[COLOR="PINK"]e.preventDefault();[/COLOR]
$("#{$editorid}").removeClass("editor-mode-dive");
});
</script>
Now we got some function.
With these changes you'll notice the CSS is a little wonky, but these are all easy fixes.
Notes to change:
- Textarea needs the scrollbar on dive mode remove overflow-y: hidden; from inline because the jquery already autosizes the height this is not needed
- the inherit width needs to be removed from .editor-mode-dive textarea
- controlbar-container needs scrollbars removed and height adjusted
- the post button will need to be added to the dive mode.
But I figured someone was stuck somewhere thats why this wasn't fixed, so I thought I'd help. I am a vBulletin developer and I would love to be on the design team!
Last edited: