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

Update last focus manager #3004

wants to merge 4 commits into from

Conversation

@easylogic
Copy link
Member

@easylogic 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
Copy link

@coveralls 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 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
Author 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
Author 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
Author Member

ok, i will remove comment.

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

@hackerwins 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 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
Author Member

i added this code.

This was referenced Nov 4, 2018
easylogic added 2 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants