From 340f004fd0b2e289ca2985797a2451f9054789af Mon Sep 17 00:00:00 2001 From: Matthew Kastor Date: Mon, 1 Apr 2013 15:44:50 -0400 Subject: [PATCH] adds getFontSize to editor --- lib/ace/editor.js | 8 ++++++++ lib/ace/ext/show_settings_menu.js | 5 ----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/ace/editor.js b/lib/ace/editor.js index 87c51790..d683be2a 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -343,6 +343,14 @@ var Editor = function(renderer, session) { this.renderer.unsetStyle(style); }; + /** + * Gets the current font size of the editor text. + */ + this.getFontSize = function () { + return getComputedStyle( + this.container).getPropertyValue('font-size'); + }; + /** * Set a new font size (in pixels) for the editor text. * @param {String} size A font size ( _e.g._ "12px") diff --git a/lib/ace/ext/show_settings_menu.js b/lib/ace/ext/show_settings_menu.js index 9d9810ed..311c70c1 100644 --- a/lib/ace/ext/show_settings_menu.js +++ b/lib/ace/ext/show_settings_menu.js @@ -70,11 +70,6 @@ define(function(require, exports, module) { // when building the settings menu matching get and set functions // must be found or the function will be ignored - editor.getFontSize = function () { - return getComputedStyle( - editor.container).getPropertyValue('font-size'); - }; - // this allows the settings menu to supply a wrap limit // using a text input field easily editor.session.setWrapLimit = function (limit) {