Skip to content

Refactor editor cont.#417

Merged
jackycute merged 14 commits intomasterfrom
refactor
Apr 10, 2017
Merged

Refactor editor cont.#417
jackycute merged 14 commits intomasterfrom
refactor

Conversation

@Yukaii
Copy link
Copy Markdown
Member

@Yukaii Yukaii commented Apr 5, 2017

Changes

  • Seperate line:column and selection event binding
  • Implement multiple event listener on the same CM event
    const editor = new Editor()
    editor.on('cm-event', function() { console.log('first function 1') })
    editor.on('cm-event', function() { console.log('first function 2') })
    • Editor class maintain an array of functions internally, call each one on CM event sequentially
  • Move addStatusbar method into editor class, since it's component of editor
  • Drop global ui referencing in extra.js
  • Minor coding fixes
  • Create a editor config class (public/js/lib/editor/config.js), just a simple object store that can be shared across classes.
    const config = require('./lib/editor/config')
    config.abc = 'xyz'

@Yukaii Yukaii added the refactor label Apr 5, 2017
@Yukaii Yukaii requested review from a60814billy and jackycute April 6, 2017 01:22
@jackycute
Copy link
Copy Markdown
Member

Thanks @Yukaii

@jackycute jackycute merged commit 5ecea7e into master Apr 10, 2017
@Yukaii Yukaii deleted the refactor branch April 10, 2017 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants