quill-mention
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -1,1 +0,1 @@ | ||
!function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e){t.exports=Quill},function(t,e,n){"use strict";var i,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=(i=n(0))&&i.__esModule?i:{default:i},a=s.default.import("blots/embed"),r=function(t){function e(){return function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a),o(e,null,[{key:"create",value:function(t){var n=function t(e,n,i){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var s=Object.getPrototypeOf(e);return null===s?void 0:t(s,n,i)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(i):void 0}(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this),i=document.createElement("span");return i.className="ql-mention-denotation-char",i.innerHTML=t.denotationChar,n.appendChild(i),n.innerHTML+=t.value,n.dataset.id=t.id,n.dataset.value=t.value,n.dataset.denotationChar=t.denotationChar,n}},{key:"value",value:function(t){return{id:t.dataset.id,value:t.dataset.value,denotationChar:t.dataset.denotationChar}}}]),e}();r.blotName="mention",r.tagName="span",r.className="mention",s.default.register(r)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={TAB:9,ENTER:13,ESCAPE:27,UP:38,DOWN:40}},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=r(n(0)),a=r(n(2));function r(t){return t&&t.__esModule?t:{default:t}}n(6),n(1);var h=function(){function t(e,n){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this),this.isOpen=!1,this.itemIndex=0,this.mentionCharPos=null,this.cursorPos=null,this.values=[],this.suspendMouseEnter=!1,this.quill=e,this.options={source:null,renderItem:function(t,e){return""+t.value},mentionDenotationChars:["@"],allowedChars:/^[a-zA-Z0-9_]*$/,minChars:0,maxChars:31,offsetTop:2,offsetLeft:0,isolateCharacter:!1,fixMentionsToQuill:!1},i(this.options,n),this.mentionContainer=document.createElement("div"),this.mentionContainer.className="ql-mention-list-container",this.mentionContainer.style.cssText="display: none; position: absolute;",this.mentionContainer.onmousemove=this.onContainerMouseMove.bind(this),this.options.fixMentionsToQuill&&(this.mentionContainer.style.width="auto"),this.mentionList=document.createElement("ul"),this.mentionList.className="ql-mention-list",this.mentionContainer.appendChild(this.mentionList),document.body.appendChild(this.mentionContainer),e.on("text-change",this.onTextChange.bind(this)),e.on("selection-change",this.onSelectionChange.bind(this)),e.keyboard.addBinding({key:a.default.TAB},this.selectHandler.bind(this)),e.keyboard.bindings[9].unshift(e.keyboard.bindings[9].pop()),e.keyboard.addBinding({key:a.default.ENTER},this.selectHandler.bind(this)),e.keyboard.bindings[13].unshift(e.keyboard.bindings[13].pop()),e.keyboard.addBinding({key:a.default.ESCAPE},this.escapeHandler.bind(this)),e.keyboard.addBinding({key:a.default.UP},this.upHandler.bind(this)),e.keyboard.addBinding({key:a.default.DOWN},this.downHandler.bind(this))}return o(t,[{key:"selectHandler",value:function(){return!this.isOpen||(this.selectItem(),!1)}},{key:"escapeHandler",value:function(){return!this.isOpen||(this.hideMentionList(),!1)}},{key:"upHandler",value:function(){return!this.isOpen||(this.prevItem(),!1)}},{key:"downHandler",value:function(){return!this.isOpen||(this.nextItem(),!1)}},{key:"showMentionList",value:function(){this.mentionContainer.style.visibility="hidden",this.mentionContainer.style.display="",this.setMentionContainerPosition(),this.isOpen=!0}},{key:"hideMentionList",value:function(){this.mentionContainer.style.display="none",this.isOpen=!1}},{key:"highlightItem",value:function(){for(var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=0;e<this.mentionList.childNodes.length;e+=1)this.mentionList.childNodes[e].classList.remove("selected");if(this.mentionList.childNodes[this.itemIndex].classList.add("selected"),t){var n=this.mentionList.childNodes[this.itemIndex].offsetHeight,i=this.itemIndex*n,o=this.mentionContainer.scrollTop,s=o+this.mentionContainer.offsetHeight;i<o?this.mentionContainer.scrollTop=i:i>s-n&&(this.mentionContainer.scrollTop+=i-s+n)}}},{key:"getItemData",value:function(){return{id:this.mentionList.childNodes[this.itemIndex].dataset.id,value:this.mentionList.childNodes[this.itemIndex].dataset.value,denotationChar:this.mentionList.childNodes[this.itemIndex].dataset.denotationChar}}},{key:"onContainerMouseMove",value:function(){this.suspendMouseEnter=!1}},{key:"selectItem",value:function(){var t=this.getItemData();this.quill.deleteText(this.mentionCharPos,this.cursorPos-this.mentionCharPos,s.default.sources.API),this.quill.insertEmbed(this.mentionCharPos,"mention",t,s.default.sources.API),this.quill.insertText(this.mentionCharPos+1," ",s.default.sources.API),this.quill.setSelection(this.mentionCharPos+2,s.default.sources.API),this.hideMentionList()}},{key:"onItemMouseEnter",value:function(t){if(!this.suspendMouseEnter){var e=Number(t.target.dataset.index);Number.isNaN(e)||e===this.itemIndex||(this.itemIndex=e,this.highlightItem(!1))}}},{key:"onItemClick",value:function(t){t.stopImmediatePropagation(),t.preventDefault(),this.itemIndex=t.currentTarget.dataset.index,this.highlightItem(),this.selectItem()}},{key:"renderList",value:function(t,e,n){if(e&&e.length>0){this.values=e,this.mentionList.innerHTML="";for(var i=0;i<e.length;i+=1){var o=document.createElement("li");o.className="ql-mention-list-item",o.dataset.index=i,o.dataset.id=e[i].id,o.dataset.value=e[i].value,o.dataset.denotationChar=t,o.innerHTML=this.options.renderItem(e[i],n),o.onmouseenter=this.onItemMouseEnter.bind(this),o.onclick=this.onItemClick.bind(this),this.mentionList.appendChild(o)}this.itemIndex=0,this.highlightItem(),this.showMentionList()}else this.hideMentionList()}},{key:"nextItem",value:function(){this.itemIndex=(this.itemIndex+1)%this.values.length,this.suspendMouseEnter=!0,this.highlightItem()}},{key:"prevItem",value:function(){this.itemIndex=(this.itemIndex+this.values.length-1)%this.values.length,this.suspendMouseEnter=!0,this.highlightItem()}},{key:"hasValidChars",value:function(t){return this.options.allowedChars.test(t)}},{key:"containerBottomIsNotVisible",value:function(t){return t+this.mentionContainer.offsetHeight>window.pageYOffset+window.innerHeight}},{key:"containerRightIsNotVisible",value:function(t){return!this.options.fixMentionsToQuill&&t+this.mentionContainer.offsetWidth>window.pageXOffset+document.documentElement.clientWidth}},{key:"setMentionContainerPosition",value:function(){var t=this.quill.container.getBoundingClientRect(),e=this.quill.getBounds(this.mentionCharPos),n=window.pageYOffset+this.options.offsetTop,i=window.pageXOffset+t.left+this.options.offsetLeft;if(this.options.fixMentionsToQuill){n+=t.bottom;var o=window.outerWidth-t.right;this.mentionContainer.style.right=o+"px"}else i+=e.left,n+=t.top+e.bottom;if(this.containerBottomIsNotVisible(n)){var s=this.mentionContainer.offsetHeight+this.options.offsetTop,a=window.pageYOffset+t.top;this.options.fixMentionsToQuill||(a+=e.top),n=a-s}if(this.containerRightIsNotVisible(i)){var r=this.mentionContainer.offsetWidth+this.options.offsetLeft;i=window.pageXOffset+document.documentElement.clientWidth-r}this.mentionContainer.style.top=n+"px",this.mentionContainer.style.left=i+"px",this.mentionContainer.style.visibility="visible"}},{key:"onSomethingChange",value:function(){var t=this.quill.getSelection();if(null!=t){this.cursorPos=t.index;var e=Math.max(0,this.cursorPos-this.options.maxChars),n=this.quill.getText(e,this.cursorPos-e),i=this.options.mentionDenotationChars.reduce(function(t,e){var i=t,o=n.lastIndexOf(e);return o>i?o:i},-1);if(i>-1){if(this.options.isolateCharacter&&0!=i&&!n[i-1].match(/\s/g))return void this.hideMentionList();var o=this.cursorPos-(n.length-i);this.mentionCharPos=o;var s=n.substring(i+1);if(s.length>=this.options.minChars&&this.hasValidChars(s)){var a=n[i];this.options.source(s,this.renderList.bind(this,a),a)}else this.hideMentionList()}else this.hideMentionList()}}},{key:"onTextChange",value:function(t,e,n){"user"===n&&this.onSomethingChange()}},{key:"onSelectionChange",value:function(t){t&&0===t.length?this.onSomethingChange():this.hideMentionList()}}]),t}();s.default.register("modules/mention",h)},function(t,e,n){t.exports=n(3)},,function(t,e){}]); | ||
!function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e){t.exports=Quill},function(t,e,n){"use strict";var i,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=(i=n(0))&&i.__esModule?i:{default:i},a=s.default.import("blots/embed"),r=function(t){function e(){return function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a),o(e,null,[{key:"create",value:function(t){var n=function t(e,n,i){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var s=Object.getPrototypeOf(e);return null===s?void 0:t(s,n,i)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(i):void 0}(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this),i=document.createElement("span");return i.className="ql-mention-denotation-char",i.innerHTML=t.denotationChar,n.appendChild(i),n.innerHTML+=t.value,n.dataset.id=t.id,n.dataset.value=t.value,n.dataset.denotationChar=t.denotationChar,t.link&&(n.dataset.link=t.link),n}},{key:"value",value:function(t){return{id:t.dataset.id,value:t.dataset.value,link:t.dataset.link||null,denotationChar:t.dataset.denotationChar}}}]),e}();r.blotName="mention",r.tagName="span",r.className="mention",s.default.register(r)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={TAB:9,ENTER:13,ESCAPE:27,UP:38,DOWN:40}},function(t,e,n){"use strict";var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=r(n(0)),a=r(n(2));function r(t){return t&&t.__esModule?t:{default:t}}n(6),n(1);var l=function(){function t(e,n){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this),this.isOpen=!1,this.itemIndex=0,this.mentionCharPos=null,this.cursorPos=null,this.values=[],this.suspendMouseEnter=!1,this.quill=e,this.options={source:null,renderItem:function(t,e){return""+t.value},mentionDenotationChars:["@"],allowedChars:/^[a-zA-Z0-9_]*$/,minChars:0,maxChars:31,offsetTop:2,offsetLeft:0,isolateCharacter:!1,fixMentionsToQuill:!1},i(this.options,n),this.mentionContainer=document.createElement("div"),this.mentionContainer.className="ql-mention-list-container",this.mentionContainer.style.cssText="display: none; position: absolute;",this.mentionContainer.onmousemove=this.onContainerMouseMove.bind(this),this.options.fixMentionsToQuill&&(this.mentionContainer.style.width="auto"),this.mentionList=document.createElement("ul"),this.mentionList.className="ql-mention-list",this.mentionContainer.appendChild(this.mentionList),document.body.appendChild(this.mentionContainer),e.on("text-change",this.onTextChange.bind(this)),e.on("selection-change",this.onSelectionChange.bind(this)),e.keyboard.addBinding({key:a.default.TAB},this.selectHandler.bind(this)),e.keyboard.bindings[9].unshift(e.keyboard.bindings[9].pop()),e.keyboard.addBinding({key:a.default.ENTER},this.selectHandler.bind(this)),e.keyboard.bindings[13].unshift(e.keyboard.bindings[13].pop()),e.keyboard.addBinding({key:a.default.ESCAPE},this.escapeHandler.bind(this)),e.keyboard.addBinding({key:a.default.UP},this.upHandler.bind(this)),e.keyboard.addBinding({key:a.default.DOWN},this.downHandler.bind(this))}return o(t,[{key:"selectHandler",value:function(){return!this.isOpen||(this.selectItem(),!1)}},{key:"escapeHandler",value:function(){return!this.isOpen||(this.hideMentionList(),!1)}},{key:"upHandler",value:function(){return!this.isOpen||(this.prevItem(),!1)}},{key:"downHandler",value:function(){return!this.isOpen||(this.nextItem(),!1)}},{key:"showMentionList",value:function(){this.mentionContainer.style.visibility="hidden",this.mentionContainer.style.display="",this.setMentionContainerPosition(),this.isOpen=!0}},{key:"hideMentionList",value:function(){this.mentionContainer.style.display="none",this.isOpen=!1}},{key:"highlightItem",value:function(){for(var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=0;e<this.mentionList.childNodes.length;e+=1)this.mentionList.childNodes[e].classList.remove("selected");if(this.mentionList.childNodes[this.itemIndex].classList.add("selected"),t){var n=this.mentionList.childNodes[this.itemIndex].offsetHeight,i=this.itemIndex*n,o=this.mentionContainer.scrollTop,s=o+this.mentionContainer.offsetHeight;i<o?this.mentionContainer.scrollTop=i:i>s-n&&(this.mentionContainer.scrollTop+=i-s+n)}}},{key:"getItemData",value:function(){var t=this.mentionList.childNodes[this.itemIndex].dataset.link;return{id:this.mentionList.childNodes[this.itemIndex].dataset.id,value:t?'<a href="'+t+'" target="_blank">'+this.mentionList.childNodes[this.itemIndex].dataset.value:this.mentionList.childNodes[this.itemIndex].dataset.value,link:t||null,denotationChar:this.mentionList.childNodes[this.itemIndex].dataset.denotationChar}}},{key:"onContainerMouseMove",value:function(){this.suspendMouseEnter=!1}},{key:"selectItem",value:function(){var t=this.getItemData();this.quill.deleteText(this.mentionCharPos,this.cursorPos-this.mentionCharPos,s.default.sources.API),this.quill.insertEmbed(this.mentionCharPos,"mention",t,s.default.sources.API),this.quill.insertText(this.mentionCharPos+1," ",s.default.sources.API),this.quill.setSelection(this.mentionCharPos+2,s.default.sources.API),this.hideMentionList()}},{key:"onItemMouseEnter",value:function(t){if(!this.suspendMouseEnter){var e=Number(t.target.dataset.index);Number.isNaN(e)||e===this.itemIndex||(this.itemIndex=e,this.highlightItem(!1))}}},{key:"onItemClick",value:function(t){t.stopImmediatePropagation(),t.preventDefault(),this.itemIndex=t.currentTarget.dataset.index,this.highlightItem(),this.selectItem()}},{key:"renderList",value:function(t,e,n){if(e&&e.length>0){this.values=e,this.mentionList.innerHTML="";for(var i=0;i<e.length;i+=1){var o=document.createElement("li");o.className="ql-mention-list-item",o.dataset.index=i,o.dataset.id=e[i].id,o.dataset.value=e[i].value,o.dataset.denotationChar=t,e[i].link&&(o.dataset.link=e[i].link),o.innerHTML=this.options.renderItem(e[i],n),o.onmouseenter=this.onItemMouseEnter.bind(this),o.onclick=this.onItemClick.bind(this),this.mentionList.appendChild(o)}this.itemIndex=0,this.highlightItem(),this.showMentionList()}else this.hideMentionList()}},{key:"nextItem",value:function(){this.itemIndex=(this.itemIndex+1)%this.values.length,this.suspendMouseEnter=!0,this.highlightItem()}},{key:"prevItem",value:function(){this.itemIndex=(this.itemIndex+this.values.length-1)%this.values.length,this.suspendMouseEnter=!0,this.highlightItem()}},{key:"hasValidChars",value:function(t){return this.options.allowedChars.test(t)}},{key:"containerBottomIsNotVisible",value:function(t){return t+this.mentionContainer.offsetHeight>window.pageYOffset+window.innerHeight}},{key:"containerRightIsNotVisible",value:function(t){return!this.options.fixMentionsToQuill&&t+this.mentionContainer.offsetWidth>window.pageXOffset+document.documentElement.clientWidth}},{key:"setMentionContainerPosition",value:function(){var t=this.quill.container.getBoundingClientRect(),e=this.quill.getBounds(this.mentionCharPos),n=window.pageYOffset+this.options.offsetTop,i=window.pageXOffset+t.left+this.options.offsetLeft;if(this.options.fixMentionsToQuill){n+=t.bottom;var o=window.outerWidth-t.right;this.mentionContainer.style.right=o+"px"}else i+=e.left,n+=t.top+e.bottom;if(this.containerBottomIsNotVisible(n)){var s=this.mentionContainer.offsetHeight+this.options.offsetTop,a=window.pageYOffset+t.top;this.options.fixMentionsToQuill||(a+=e.top),n=a-s}if(this.containerRightIsNotVisible(i)){var r=this.mentionContainer.offsetWidth+this.options.offsetLeft;i=window.pageXOffset+document.documentElement.clientWidth-r}this.mentionContainer.style.top=n+"px",this.mentionContainer.style.left=i+"px",this.mentionContainer.style.visibility="visible"}},{key:"onSomethingChange",value:function(){var t=this.quill.getSelection();if(null!=t){this.cursorPos=t.index;var e=Math.max(0,this.cursorPos-this.options.maxChars),n=this.quill.getText(e,this.cursorPos-e),i=this.options.mentionDenotationChars.reduce(function(t,e){var i=t,o=n.lastIndexOf(e);return o>i?o:i},-1);if(i>-1){if(this.options.isolateCharacter&&0!=i&&!n[i-1].match(/\s/g))return void this.hideMentionList();var o=this.cursorPos-(n.length-i);this.mentionCharPos=o;var s=n.substring(i+1);if(s.length>=this.options.minChars&&this.hasValidChars(s)){var a=n[i];this.options.source(s,this.renderList.bind(this,a),a)}else this.hideMentionList()}else this.hideMentionList()}}},{key:"onTextChange",value:function(t,e,n){"user"===n&&this.onSomethingChange()}},{key:"onSelectionChange",value:function(t){t&&0===t.length?this.onSomethingChange():this.hideMentionList()}}]),t}();s.default.register("modules/mention",l)},function(t,e,n){t.exports=n(3)},,function(t,e){}]); |
{ | ||
"name": "quill-mention", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "@mentions for the Quill rich text editor", | ||
@@ -5,0 +5,0 @@ "main": "src/quill.mention.js", |
@@ -17,2 +17,5 @@ import Quill from 'quill'; | ||
node.dataset.denotationChar = data.denotationChar; | ||
if (data.link) { | ||
node.dataset.link = data.link; | ||
} | ||
return node; | ||
@@ -25,2 +28,3 @@ } | ||
value: domNode.dataset.value, | ||
link: domNode.dataset.link || null, | ||
denotationChar: domNode.dataset.denotationChar, | ||
@@ -27,0 +31,0 @@ }; |
@@ -143,5 +143,9 @@ import Quill from 'quill'; | ||
getItemData() { | ||
const itemLink = this.mentionList.childNodes[this.itemIndex].dataset.link; | ||
return { | ||
id: this.mentionList.childNodes[this.itemIndex].dataset.id, | ||
value: this.mentionList.childNodes[this.itemIndex].dataset.value, | ||
value: itemLink ? | ||
`<a href="${itemLink}" target="_blank">${this.mentionList.childNodes[this.itemIndex].dataset.value}` : | ||
this.mentionList.childNodes[this.itemIndex].dataset.value, | ||
link: itemLink || null, | ||
denotationChar: this.mentionList.childNodes[this.itemIndex].dataset.denotationChar, | ||
@@ -197,2 +201,5 @@ }; | ||
li.dataset.denotationChar = mentionChar; | ||
if (data[i].link) { | ||
li.dataset.link = data[i].link; | ||
} | ||
li.innerHTML = this.options.renderItem(data[i], searchTerm); | ||
@@ -199,0 +206,0 @@ li.onmouseenter = this.onItemMouseEnter.bind(this); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32778
355