couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject [3/8] fauxton commit: updated refs/heads/secondary-indexes to 4c45e12
Date Mon, 28 Jul 2014 13:47:51 GMT
Fine tune string edit.


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

Branch: refs/heads/secondary-indexes
Commit: d68bc8e4c6c72118f8679f82651b04216b3afae6
Parents: 12f282c
Author: sebastianrothbucher <sebastianrothbucher@googlemail.com>
Authored: Thu Jul 24 23:00:06 2014 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Fri Jul 25 09:55:05 2014 +0200

----------------------------------------------------------------------
 app/addons/documents/views-doceditor.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/d68bc8e4/app/addons/documents/views-doceditor.js
----------------------------------------------------------------------
diff --git a/app/addons/documents/views-doceditor.js b/app/addons/documents/views-doceditor.js
index 5514bd2..e05b8f4 100644
--- a/app/addons/documents/views-doceditor.js
+++ b/app/addons/documents/views-doceditor.js
@@ -252,8 +252,9 @@ function(app, FauxtonAPI, Components, Documents, Databases,
       var editMatch = this.determineStringEditMatch(event);
       if (editMatch) {
         this.$("button.string-edit").removeAttr("disabled");
-	/* remove the following line (along with CSS) to go back to the toolbar */
-        this.$("button.string-edit").css("top", (this.$("#editor-container")[0].offsetTop
- 2 + this.editor.getRowHeight() * this.editor.documentToScreenRow(this.editor.getSelectionStart().row))
+ "px");
+        /* remove the following line (along with CSS) to go back to the toolbar: take the
offset top of the editor, go down as many lines as we are positioned including fold and adjust
by two pixels as the button is slightly larger than a line */
+        var positionFromTop = (this.$("#editor-container").offset().top - 2 + this.editor.getRowHeight()
* this.editor.documentToScreenRow(this.editor.getSelectionStart().row));
+        this.$("button.string-edit").css("top", positionFromTop + "px");
         return true;
       }
       return false;


Mime
View raw message