Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update last focus manager #3004

Closed
wants to merge 4 commits into from
Closed

Conversation

easylogic
Copy link
Member

What does this PR do?

Where should the reviewer start?

  • start on the src/base/module/Edditor.js

How should this be manually tested?

  • npm start
  • open localhost:3000
  • open browser console
  • run $(".summernote").summernote("editor.insertText", "aaa")

Any background context you want to provide?

What are the relevant tickets?

#33
#2141
#1520

Screenshot (if for frontend)

Checklist

@coveralls
Copy link

coveralls commented Oct 30, 2018

Coverage Status

Coverage increased (+0.03%) to 77.587% when pulling ef20bc1 on hotfix/last-focus-manage into 8b386f4 on develop.

@lqez
Copy link
Member

lqez commented Oct 30, 2018

@easylogic Could you remove dist files from PR?

@@ -0,0 +1,75 @@
import $ from 'jquery';
Copy link
Member

@lqez lqez Oct 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about to add a credit of @dubiousandrew who created AutoReplace module at first?

@@ -49,7 +49,7 @@ describe('LinkDialog', () => {
dialog.show();

var checked = dialog.$dialog.find('#sn-checkbox-open-in-new-window').is(':checked');
expect(checked).to.be.false;
expect(checked).to.be.true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an intended change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not seem to be related to the commit. strange.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true is default value to open newWindow in LinkDialog.

checked: true

so test was always fail.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified above code to use createRange in LinkDialog, but I always get an error

@@ -442,7 +447,20 @@ export default class Editor {
*/
createRange() {
this.focus();
return range.create(this.editable);
// return range.create(this.editable);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that there are many range.create calling at internal and external modules. Is there a chance to use range.create from outside of Editor.js module?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to remove comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i will remove comment.

@lqez lqez mentioned this pull request Oct 30, 2018
2 tasks
@hackerwins
Copy link
Member

hackerwins commented Oct 30, 2018

Can you tell us when to use getLastRange and createRange respectively?
The purpose of the two is different, and I am confused when to use it.

@easylogic
Copy link
Member Author

easylogic commented Nov 1, 2018

@hackerwins

createRange is always run focus action at first.
but getLastRange only return focused range element at last.

@@ -300,5 +302,3 @@ $.summernote = $.extend($.summernote, {
}
}
});

import '../summernote'; // eslint-disable-line
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This need to recover.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i added this code.

This was referenced Nov 4, 2018
@easylogic easylogic closed this Nov 6, 2018
@easylogic easylogic deleted the hotfix/last-focus-manage branch November 28, 2018 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants