You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello i am using angularjs 1.6 with components.
All is working fine but on my insert invent i would like to set the cursor after the span inserted. Because if i'm adding a class it will be add to all after because all will be in the span elem
` var article = document.getElementById('editor');
var container = article.parentNode;
var medium;
this.$onInit = function() {
setTimeout(function(){
medium = new Medium({
element: article,
mode: Medium.richMode,
placeholder: 'Your Article',
tags: null,
attributes: null
});
container.querySelector('.insert').onmousedown = function(evt) {
var child = document.createElement('span');
child.innerHTML = evt.target.attributes.data.value;
child.addEventListener("click", function(evt){
console.log(this);
this.remove();
});
medium.focus();
medium.insertHtml(child)
medium.cursor.set(this.html.text(el).length, el);
return false;
};
}, 0);`
The text was updated successfully, but these errors were encountered:
hello i am using angularjs 1.6 with components.
All is working fine but on my insert invent i would like to set the cursor after the span inserted. Because if i'm adding a class it will be add to all after because all will be in the span elem
The text was updated successfully, but these errors were encountered: