Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Destroy markdown editor on small screen device?

+3 votes
167 views
asked Mar 21, 2016 in Plugins by Septian Nugroho
the problem is the markdown editor can not be responsive. is it possible to destroy markdown editor on a small device like destroying ckeditor here http://amiyasahu.com/how-to-destroy-ckeditor-in-small-screen-devices/???

Or you can suggest me what should i do....
Q2A version: 1.7.4
commented Mar 21, 2016 by fara
I have same problem.
commented Mar 22, 2016 by Septian Nugroho
Have you solve it?

1 Answer

+2 votes
answered Mar 21, 2016 by Scott
selected Mar 22, 2016 by Septian Nugroho
 
Best answer

You could add this to the get_field function in qa-markdown-editor.php

if (qa_is_mobile_probably()) {
    $html = '<textarea name="'.$fieldname.'" id="wmd-input-'.$fieldname.'" class="wmd-input">'.$content.'</textarea>' . "\n";
}
else {
    // the code that's already there
}

return array('type'=>'custom', 'html'=>$html);

I'll look into this for the plugin. I haven't updated the components for a while so I may be able to improve the speed there.

commented Mar 22, 2016 by Septian Nugroho
Thank for your answer. It's work... , but there any problem in ask questtion page, category list can't be load.... whats wrong?
commented Mar 22, 2016 by Septian Nugroho
it's work fine thank you....
I just replace function load_script here :
<pre>
public function load_script($fieldname)
    {
        $data ='';
        if (qa_is_mobile_probably() == false) {
        $data = 'var converter = Markdown.getSanitizingConverter();' . "\n" .
            'var editor = new Markdown.Editor(converter, "-'.$fieldname.'");' . "\n" .
            'editor.run();' . "\n";
        }
        return  $data;
    }
<pre>
...