浏览代码

make editor bigger

Nick Elser 10 年之前
父节点
当前提交
94224d8d99
共有 2 个文件被更改,包括 13 次插入2 次删除
  1. 1 1
      app/assets/stylesheets/blazer/application.css
  2. 12 1
      app/views/blazer/queries/_form.html.erb

+ 1 - 1
app/assets/stylesheets/blazer/application.css

@@ -58,7 +58,7 @@ input.search:focus {
 
 #editor {
   display: none;
-  height: 100px;
+  height: 175px;
 }
 
 .ace_print-margin-layer {

+ 12 - 1
app/views/blazer/queries/_form.html.erb

@@ -48,13 +48,24 @@
     enableSnippets: false,
     enableLiveAutocompletion: false,
     highlightActiveLine: false,
-    fontSize: 12
+    fontSize: 12,
+    minLines: 10
   });
   editor.renderer.setShowGutter(false);
   editor.renderer.setPrintMarginColumn(false);
   editor.renderer.setPadding(10);
   editor.getSession().setUseWrapMode(true);
+  editor.commands.addCommand({
+    name: 'run',
+    bindKey: {win: 'Ctrl-Enter',  mac: 'Command-Enter'},
+    exec: function(editor) {
+        $("#run").click();
+    },
+    readOnly: false // false if this command should not apply in readOnly mode
+  });
+
   $("#editor").show();
+  editor.focus();
 
   $("#run").click( function (e) {
     e.preventDefault();