From 1547c8b6e59aa82eaec4f4c98a814d7648d7e4a8 Mon Sep 17 00:00:00 2001 From: Lance Campbell Date: Tue, 8 Apr 2014 08:51:15 -0700 Subject: [PATCH] Only fire event when there is an adjustment in font size --- src/view/ViewCommandHandlers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/view/ViewCommandHandlers.js b/src/view/ViewCommandHandlers.js index 2e7806d4e..b2e65cfd7 100644 --- a/src/view/ViewCommandHandlers.js +++ b/src/view/ViewCommandHandlers.js @@ -120,7 +120,10 @@ define(function (require, exports, module) { delta = /em$/.test(oldFontSize) ? 10 : 1; newFontSize = $(".CodeMirror").css("font-size"); adjustment = parseInt((parseFloat(newFontSize) - parseFloat(oldFontSize)) * delta, 10); - $(exports).triggerHandler("fontSizeChange", [adjustment, newFontSize]); + + if (adjustment) { + $(exports).triggerHandler("fontSizeChange", [adjustment, newFontSize]); + } // Calculate the new scroll based on the old font sizes and scroll position var newWidth = editor._codeMirror.defaultCharWidth(),