Differential/meteor-blog — pull request #142 by coopermaruyama (2014-12-23 20:49:38+00:00)
Title: Bugfix editor

_(more detailed descriptions on each commit)_

**This pull request fixes and/or improves certain behavior of meteor-blog which causes bugs or makes it prone to bugs.**

### **Fixed bugs:**
1. images getting nested too much by medium-insert, due to it being called by `BlogEditor.make` on every autosave (example below):
![screenshot bug](https://s3.amazonaws.com/f.cl.ly/items/2u0p1H35292h2H3l0L2f/Screen%20Recording%202014-12-23%20at%2011.41%20AM.gif)
2. medium-insert add buttons not working due to events being bound multiple times
3. Images disappearing sometimes when switching between HTML and visual editor
4. drag and dropping images sometimes adding the same image multiple times.
5. Medium Editor initiates before existing post content is populated into the editor.

### Improvements:
1. Initial call to `BlogEditor.make` moved into the `autorun` which waits for the subscription, ensuring that any existing post content is available when setting up Medium Editor.
2. Event binding on `.mediumInsert` buttons was too broad and could cause problems. Delegated it to the form to improve reliability.
3. Check if certain events have already bound to prevent duplicate binding
4. Update Medium Editor to 1.9.13
5. Update medium-editor-insert to v0.3.2

**TODO:** Rather than calling `BlogEditor.make` upon autosaving and toggling between the visual/HTML editors, we should have separate functions for each that just run the necessary parts of Medium Editor and medium insert.