Skip to content

Commit

Permalink
Fix pagelinks plugin in richeditor (octobercms#5553)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxy authored Apr 9, 2021
1 parent 63f9a36 commit c4e3903
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,19 @@ $.FroalaEditor.DEFAULTS.key = 'JA6B2B5A1qB1F1F4D3I1A15A11D3E6B5dVh1VCQWa1EOQFe1N
$input = $(check_inputs[i]);
$input.prop('checked', $input.data('checked') == link[$input.attr('name')]);
}

// Restore selection, so that the link gets inserted properly.
editor.selection.restore();
}

function insertLink() {
richeditorPageLinksPlugin = this

editor.$el.popup({
handler: editor.opts.pageLinksHandler
}).one('shown.oc.popup.pageLinks', function () {
// Save the current selection so it can be restored after popup is closed.
editor.selection.save()
})
}

Expand Down

0 comments on commit c4e3903

Please sign in to comment.