From b65813486db958e9c389c2a97735ac740ae346b6 Mon Sep 17 00:00:00 2001 From: benweet Date: Thu, 28 Mar 2013 23:35:32 +0000 Subject: [PATCH] gdrive support --- js/main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/main.js b/js/main.js index 0227e623..54f1ccf8 100644 --- a/js/main.js +++ b/js/main.js @@ -333,15 +333,19 @@ var core = (function($) { }); }; - core.createEditor = function(textChangeCallback) { + core.createEditor = function(onTextChange) { $("#wmd-button-bar").empty(); var converter = Markdown.getSanitizingConverter(); + var firstChange = true; converter.hooks.chain("preConversion", function (text) { - textChangeCallback(); + if(!firstChange) { + onTextChange(); + } return text; }); var editor = new Markdown.Editor(converter); editor.run(); + firstChange = false; $(".wmd-button-row").addClass("btn-group").find("li:not(.wmd-spacer)") .addClass("btn").css("left", 0).find("span").hide();