couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowalski <>
Subject [GitHub] couchdb-fauxton pull request: Update full page document editor
Date Thu, 25 Dec 2014 16:44:05 GMT
Github user robertkowalski commented on a diff in the pull request:
    --- Diff: app/addons/documents/views-doceditor.js ---
    @@ -529,13 +454,160 @@ function (app, FauxtonAPI, Components, Documents, Databases, prettify)
    +        // place focus on the editor
    +        editor.editor.focus();
    +      // this sucks having to reference #dashboard, but when user clicks in the region
below the editor I want it
    +      // to focus on the final line. It feels natural that way
    +      $('.scrollable').on('click', function(e) {
    --- End diff --
    this is a bit funky - we have access to `.scrollable` so I also can't imagine why we should
do it that way? to reuse the local variables in the scope?
    here is a solution (at the top of the literal):
      Views.CodeEditor = FauxtonAPI.View.extend({
        template: 'addons/documents/templates/code_editor',
        className: 'editor-content-page',
        events: {
          'click': 'saveDoc',
          'click button.delete': 'destroy',
          'click button.duplicate': 'duplicate',
          'click button.upload': 'upload',
          'click button.string-edit': 'stringEditing',
          'click a.js-back': 'onClickGoBack',
          'click .scrollable': 'focusOnLastLine'
        focusOnLastLine: function (e) {
          var clickedInEditor = $('#editor-container');
          if (clickedInEditor.length === 0) {
            var session = this.editor.editor.getSession();
            var count = session.getLength();
            this.editor.editor.gotoLine(count, session.getLine(count-1).length);

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message