You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2015/03/31 20:05:06 UTC

fauxton commit: updated refs/heads/master to 5d2fdcc

Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master d7641f16e -> 5d2fdcc8e


Ace Editor code update

This makes a small change to the Ace Editor component to allow
overriding the default manual JS resizing of the editor. Going
forward we can use flexbox to handle all of that for us, which
will let us drop a lot of the unnecessary JS code to manually
resize the editor based on available space and window resizes,
etc.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/5d2fdcc8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/5d2fdcc8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/5d2fdcc8

Branch: refs/heads/master
Commit: 5d2fdcc8e664d459805d12ade402285e7ed91b68
Parents: d7641f1
Author: Ben Keen <be...@gmail.com>
Authored: Mon Mar 30 09:52:13 2015 -0700
Committer: Ben Keen <be...@gmail.com>
Committed: Tue Mar 31 11:07:27 2015 -0700

----------------------------------------------------------------------
 app/addons/fauxton/components.js | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/5d2fdcc8/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index 7d5d766..df2a332 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -588,6 +588,10 @@ function (app, FauxtonAPI, ace, spin, ZeroClipboard) {
       this.commands = options.commands;
       this.theme = options.theme || 'idle_fingers';
       this.couchJSHINT = options.couchJSHINT;
+
+      // going forward we can use flexbox for all editors with a fixed height and drop all custom JS to adjust its height
+      this.setHeightWithJS = _.has(options, 'setHeightWithJS') ? options.setHeightWithJS : true;
+
       this.edited = false;
 
       // the full-page document editor does some extra work to adjust the total height of the editor based
@@ -658,6 +662,9 @@ function (app, FauxtonAPI, ace, spin, ZeroClipboard) {
     },
 
     setHeightToLineCount: function () {
+      if (!this.setHeightWithJS) {
+        return;
+      }
       var lines = this.editor.getSession().getDocument().getLength();
 
       if (this.isFullPageEditor) {