refactory-id / bootstrap-markdown

Bootstrap plugin for markdown editing
Apache License 2.0
1.99k stars 371 forks source link

No fullscreen when editor is inside a modal #133

Closed ghost closed 7 years ago

ghost commented 9 years ago

If the editor is placed inside a bootstrap modal, the fulscreen doesn't open successfully.

toopay commented 9 years ago

@luisafonsocarvalho can you provide some screenshot? I never try to embed markdown editor on modal, but i think it will be common case for people to do so. I'll find out if its an easy fix.

ghost commented 9 years ago

Editor in modal Editor in fullscreen

There you go.

The markup for the modal is the following (i'm omitting the other divs the bootstrap modal requires for clarity):

<div class="modal-body" id="post-body">
    <form class="form-horizontal" role="form" id="pub-form">
        <div class="form-group">
            <label for="title" class="col-md-2 control-label">Título</label>
            <div class="col-md-10">
                <input name="title" type="text" class="form-control"id="edit-title" value=$node->title>
            </div>
        </div>
        <div class="form-group">
            <label for="edit-body" class="col-md-2 control-label">Corpo</label>
            <div class="col-md-10">
               <textarea id="edit-body" class="form-control">$node->body</textarea>
           </div>
        </div>
    </form>
</div>
kjeske commented 9 years ago

+1

divad commented 9 years ago

+1

abreksa4 commented 8 years ago

+1

ykoryakov commented 8 years ago

+1

jeromemiranda commented 7 years ago

+1

lodev09 commented 7 years ago

Okay I'm afraid there is no "official" fix for this within the plugin. The .modal-dialog is containing the .md-editor.md-fullscreen-mode block. If only css has a "parent selector" then this would be much easier :(

However, onFullscreen and onFullscreenExit events are the workaround to fix this issue. Modify modal-dialog css via js on the fly. onFullscreen event, turn it into:

.modal-dialog {
  width: 100%;
  height: 100%;
  margin: 0;
}

then remove them on fullscreen end