Skip to content

Update last focus manager#3004

Closed
easylogic wants to merge 4 commits into
developfrom
hotfix/last-focus-manage
Closed

Update last focus manager#3004
easylogic wants to merge 4 commits into
developfrom
hotfix/last-focus-manage

Conversation

@easylogic

Copy link
Copy Markdown
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

@easylogic
easylogic requested review from hackerwins and lqez October 30, 2018 12:08
@coveralls

coveralls commented Oct 30, 2018

Copy link
Copy Markdown

Coverage Status

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

@lqez

lqez commented Oct 30, 2018

Copy link
Copy Markdown
Member

@easylogic Could you remove dist files from PR?

Comment thread src/js/base/module/AutoReplace.js Outdated
@@ -0,0 +1,75 @@
import $ from 'jquery';

@lqez lqez Oct 30, 2018

Copy link
Copy Markdown
Member

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?


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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Comment thread src/js/base/module/Editor.js Outdated
createRange() {
this.focus();
return range.create(this.editable);
// return range.create(this.editable);

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

hackerwins commented Oct 30, 2018

Copy link
Copy Markdown
Member

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

easylogic commented Nov 1, 2018

Copy link
Copy Markdown
Member Author

@hackerwins

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

Comment thread src/js/bs4/settings.js
}
});

import '../summernote'; // eslint-disable-line

Copy link
Copy Markdown
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
Copy Markdown
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 requested review from hackerwins and lqez November 5, 2018 13:09
@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.

4 participants