Giter Club home page Giter Club logo

Comments (5)

pandao avatar pandao commented on May 17, 2024

我把onchange回调处理合并到saveToTextareas()方法里了。比如在第一次加载时,通过动态设置markdown源文档的,可视作change了,但想想如果markdown是直接就设在textarea里,又不合理了。再考虑一下是否修改一下。

from editor.md.

tylerlong avatar tylerlong commented on May 17, 2024

还有一个特殊场景是: texarea内容为空,或者根本没有textarea。 这时候第一次加载不应该 动态设置markdown源文档, 也就不会触发change了。

from editor.md.

pandao avatar pandao commented on May 17, 2024

还是改一下吧,初始化load后的change才算是。先标记一下。

from editor.md.

pandao avatar pandao commented on May 17, 2024

@v1.1.7 fixed.

from editor.md.

kz12 avatar kz12 commented on May 17, 2024
//http://pandao.github.io/editor.md/examples/dynamic-create-editormd.html 在此基础上添加onchange函数

var testEditormd;

$(function() {                
    $("#create-btn").click(function(){                    
        $("#layout").append("<div id=\"test-editormd\"></div>");
        
        testEditormd = editormd("test-editormd", {
            width: "90%",
            height: 640,
            markdown : "### 动态创建 Editor.md\r\n\r\nDynamic create Editor.md",
            path : '/src/editormd/lib/',
            onchange: function() {
                console.log('editor onchange.....!!!!!')
            }
        });
    });  
    
    $("#remove-btn").click(function() {
        testEditormd.editor.remove();
    });
});

当创建,然后销毁编辑器,然后之后每次创建编辑器时,都会触发onchange事件。我用的editormd版本为1.5

from editor.md.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.