Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Only fire event when there is an adjustment in font size
Browse files Browse the repository at this point in the history
  • Loading branch information
lkcampbell committed Apr 8, 2014
1 parent 479ba7b commit 1547c8b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/view/ViewCommandHandlers.js
Expand Up @@ -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(),
Expand Down

0 comments on commit 1547c8b

Please sign in to comment.