couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowalski <...@git.apache.org>
Subject [GitHub] couchdb-fauxton pull request: [WIP] Fix view bugs
Date Wed, 22 Apr 2015 12:08:42 GMT
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/391#discussion_r28865907
  
    --- Diff: app/addons/components/react-components.react.jsx ---
    @@ -63,7 +64,188 @@ function (app, FauxtonAPI, React, Components, beautifyHelper) {
       });
     
       var CodeEditor = React.createClass({
    +    getDefaultProps: function () {
    +      return {
    +        id   : 'code-editor',
    +        mode : 'javascript',
    +        theme : 'idle_fingers',
    +        fontSize : 13,
    +        code  : '',
    +        showGutter : true,
    +        highlightActiveLine : true,
    +        showPrintMargin     : false,
    +        autoScrollEditorIntoView: true,
    +        setHeightWithJS: true,
    +        isFullPageEditor: false,
    +      };
    +    },
    +
    +    hasChanged: function () {
    +      return !_.isEqual(this.props.code, this.getValue());
    +    },
    +
    +    setupAce: function (props) {
    +      this.editor = ace.edit(this.getDOMNode(this.refs.ace));
    +      // Automatically scrolling cursor into view after selection
    +      // change this will be disabled in the next version
    +      // set editor.$blockScrolling = Infinity to disable this message
    +      this.editor.$blockScrolling = Infinity;
    +
    +      this.editor.setShowPrintMargin(props.showPrintMargin);
    +      this.editor.autoScrollEditorIntoView = props.autoScrollEditorIntoView;
    +      this.setEditorValue(props.code);
    +      this.setHeightToLineCount();
    +      this.removeIncorrectAnnotations();
    +      this.editor.getSession().setMode("ace/mode/" + props.mode);
    +      this.editor.setTheme("ace/theme/" + props.theme);
    +      this.editor.setFontSize(this.props.fontSize);
    +    },
    +
    +    setupEvents: function () {
    +      $(window).on('beforeunload.editor_' + this.editorId, _.bind(this.quitWarningMsg));
    +      FauxtonAPI.beforeUnload('editor_' + this.editorId, _.bind(this.quitWarningMsg,
this));
    +    },
    +
    +    quitWarningMsg: function () {
    +      if (this.hasChanged()) {
    +        return 'Your changes have not been saved. Click cancel to return to the document.';
    +      }
    +    },
    +
    +    removeEvents: function () {
    +      $(window).off('beforeunload.editor_' + this.editorId);
    +      $(window).off('resize.editor', this.onPageResize);
    +      FauxtonAPI.removeBeforeUnload('editor_' + this.editorId);
    +    },
    --- End diff --
    
    seems that the event is not unregistered... make changes to a view... click on "all databases
in the sidebar" ... click "ok" ... click on a database in the list: popup still appears


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message