Bug fix to prevent jQuery add extra code

This commit is contained in:
Diego Najar 2019-01-30 17:53:10 +01:00
parent 376a7c6909
commit eb31e298da
3 changed files with 3 additions and 6 deletions

View File

@ -347,7 +347,7 @@ echo Bootstrap::formOpen(array(
</div> </div>
<!-- Editor --> <!-- Editor -->
<div id="jseditor" class="editable h-100" style=""><?php echo $page->contentRaw(false) ?></div> <textarea id="jseditor" class="editable h-100" style=""><?php echo $page->contentRaw(false) ?></textarea>
</form> </form>

View File

@ -318,7 +318,7 @@ echo Bootstrap::formOpen(array(
</div> </div>
<!-- Editor --> <!-- Editor -->
<div id="jseditor" class="editable h-100 mb-1"></div> <textarea id="jseditor" class="editable h-100 mb-1"></textarea>
</form> </form>

View File

@ -89,10 +89,7 @@ class pluginsimpleMDE extends Plugin {
}'.PHP_EOL; }'.PHP_EOL;
$html .= '$(document).ready(function() { '.PHP_EOL; $html .= '$(document).ready(function() { '.PHP_EOL;
$html .= ' $html .= 'simplemde = new SimpleMDE({
var currentContent = $( "#jseditor" ).html();
$( "#jseditor" ).replaceWith( "<textarea id=\"jseditor\">"+currentContent+"</textarea>" );
simplemde = new SimpleMDE({
element: document.getElementById("jseditor"), element: document.getElementById("jseditor"),
status: false, status: false,
toolbarTips: true, toolbarTips: true,