Merge branch 'stable'

# Conflicts:
#	src/public/javascripts/dialogs/add_link.js
This commit is contained in:
zadam 2019-05-13 21:42:52 +02:00
commit 93c0469aa0
2 changed files with 4 additions and 7 deletions

View File

@ -93,15 +93,16 @@ $form.submit(() => {
$dialog.modal('hide'); $dialog.modal('hide');
const linkHref = '#' + notePath; const linkHref = '#' + notePath;
const editor = noteDetailService.getActiveComponent().getEditor();
if (hasSelection()) { if (hasSelection()) {
const editor = noteDetailService.getActiveComponent().getEditor();
editor.execute('link', linkHref); editor.execute('link', linkHref);
} }
else { else {
linkService.addLinkToEditor(linkTitle, linkHref); linkService.addLinkToEditor(linkTitle, linkHref);
} }
editor.editing.view.focus();
} }
else if (linkType === 'selected-to-active') { else if (linkType === 'selected-to-active') {
const prefix = $clonePrefix.val(); const prefix = $clonePrefix.val();
@ -144,10 +145,6 @@ function linkTypeChanged() {
$linkTypes.change(linkTypeChanged); $linkTypes.change(linkTypeChanged);
// return back focus to note text detail after quitting add link
// the problem is that cursor position is reset
$dialog.on("hidden.bs.modal", () => noteDetailService.getActiveComponent().focus());
export default { export default {
showDialog, showDialog,
showDialogForClone showDialogForClone

View File

@ -92,7 +92,7 @@ async function getManyRows(query, params) {
let results = []; let results = [];
while (params.length > 0) { while (params.length > 0) {
const curParams = params.slice(0, Math.max(params.length, PARAM_LIMIT)); const curParams = params.slice(0, Math.min(params.length, PARAM_LIMIT));
params = params.slice(curParams.length); params = params.slice(curParams.length);
let i = 1; let i = 1;