From d294bf4d0509321d5fca0aeece3b5c9d3e0f2f66 Mon Sep 17 00:00:00 2001 From: probablycorey Date: Thu, 2 May 2013 10:33:38 -0700 Subject: [PATCH] :lipstick: Keep the bind commands close together --- src/app/config-panel.coffee | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/app/config-panel.coffee b/src/app/config-panel.coffee index e0dcb811b..81ec3e0ed 100644 --- a/src/app/config-panel.coffee +++ b/src/app/config-panel.coffee @@ -30,17 +30,6 @@ class ConfigPanel extends View value = @parseValue(type, value) config.set(name, value) - parseValue: (type, value) -> - switch type - when 'int' - intValue = parseInt(value) - value = intValue unless isNaN(intValue) - when 'float' - floatValue = parseFloat(value) - value = floatValue unless isNaN(floatValue) - value = undefined if value == '' - value - bindEditors: -> for editor in @find('.editor[id]').views() do (editor) => @@ -55,3 +44,14 @@ class ConfigPanel extends View editor.getBuffer().one 'contents-modified', => editor.getBuffer().on 'contents-modified', => config.set(name, @parseValue(type, editor.getText())) + + parseValue: (type, value) -> + switch type + when 'int' + intValue = parseInt(value) + value = intValue unless isNaN(intValue) + when 'float' + floatValue = parseFloat(value) + value = floatValue unless isNaN(floatValue) + value = undefined if value == '' + value