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
base: develop
from

Conversation

Projects
None yet
4 participants
@easylogic
Member

easylogic commented Oct 30, 2018

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

@easylogic easylogic requested review from lqez and hackerwins Oct 30, 2018

@coveralls

This comment has been minimized.

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

This comment has been minimized.

Member

lqez commented Oct 30, 2018

@easylogic Could you remove dist files from PR?

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

This comment has been minimized.

@lqez

lqez Oct 30, 2018

Member

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;

This comment has been minimized.

@lqez

lqez Oct 30, 2018

Member

Is this an intended change?

This comment has been minimized.

@hackerwins

hackerwins Oct 30, 2018

Member

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

This comment has been minimized.

@easylogic

easylogic Nov 1, 2018

Member

true is default value to open newWindow in LinkDialog.

checked: true

so test was always fail.

This comment has been minimized.

@easylogic

easylogic Nov 1, 2018

Member

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);

This comment has been minimized.

@lqez

lqez Oct 30, 2018

Member

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?

This comment has been minimized.

@hackerwins

hackerwins Oct 30, 2018

Member

It would be better to remove comment.

This comment has been minimized.

@easylogic

easylogic Nov 1, 2018

Member

ok, i will remove comment.

@lqez lqez referenced this pull request Oct 30, 2018

Closed

created AutoReplace module #2545

0 of 2 tasks complete
@hackerwins

This comment has been minimized.

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

This comment has been minimized.

Member

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

This comment has been minimized.

@hackerwins

hackerwins Nov 1, 2018

Member

This need to recover.

This comment has been minimized.

@easylogic

easylogic Nov 2, 2018

Member

i added this code.

This was referenced Nov 4, 2018

easylogic added some commits Nov 5, 2018

@easylogic easylogic requested review from hackerwins and lqez Nov 5, 2018

@easylogic easylogic closed this Nov 6, 2018

@easylogic easylogic deleted the hotfix/last-focus-manage branch Nov 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment