Skip to content

Commit

Permalink
JS: Fix glossary term insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Nov 29, 2020
1 parent 91cbb9e commit d2e3eef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions weblate/static/editor/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ WLT.Editor = (function () {
var hlNumberSelector = ".highlight-number";

/* Copy from source text highlight check */
this.$editor.on("click", hlSelector, function (e) {
var $this = $(this);
this.$editor.on("click", hlSelector, (e) => {
var $this = $(e.target);
var text = $this.clone();

text.find(hlNumberSelector).remove();
text = text.text();
insertEditor(text, $this);
this.insertEditor(text, $this);
e.preventDefault();
});

Expand Down Expand Up @@ -181,7 +181,7 @@ WLT.Editor = (function () {
);
};

function insertEditor(text, element) {
EditorBase.prototype.insertEditor = function (text, element) {
var root;

/* Find withing root element */
Expand All @@ -203,7 +203,7 @@ WLT.Editor = (function () {
}

editor[0].CodeMirror.replaceSelection($.trim(text));
}
};

return {
Base: EditorBase,
Expand Down

0 comments on commit d2e3eef

Please sign in to comment.