fix of post formatting: links templates caching fix

This commit is contained in:
Simon Grim 2015-07-19 05:36:59 +05:00
parent ec73147c75
commit 56dca3bfb7

View File

@ -9,12 +9,21 @@ var _htmlFormatMsgLinkTemplateHashtag;
$(document).ready(function() {
// we're setting it here for perfomance improvement purpose // to not search and prepare it for for every post every time
_htmlFormatMsgLinkTemplateExternal = $('#external-page-link-template')[0].cloneNode();
_htmlFormatMsgLinkTemplateExternal = $('#external-page-link-template')
if (_htmlFormatMsgLinkTemplateExternal.length) {
_htmlFormatMsgLinkTemplateExternal = _htmlFormatMsgLinkTemplateExternal[0].cloneNode();
_htmlFormatMsgLinkTemplateExternal.removeAttribute('id');
_htmlFormatMsgLinkTemplateUser = $('#msg-user-link-template')[0].cloneNode();
}
_htmlFormatMsgLinkTemplateUser = $('#msg-user-link-template')
if (_htmlFormatMsgLinkTemplateUser.length) {
_htmlFormatMsgLinkTemplateUser = _htmlFormatMsgLinkTemplateUser[0].cloneNode();
_htmlFormatMsgLinkTemplateUser.removeAttribute('id');
_htmlFormatMsgLinkTemplateHashtag = $('#hashtag-link-template')[0].cloneNode();
}
_htmlFormatMsgLinkTemplateHashtag = $('#hashtag-link-template')
if (_htmlFormatMsgLinkTemplateHashtag.length) {
_htmlFormatMsgLinkTemplateHashtag = _htmlFormatMsgLinkTemplateHashtag[0].cloneNode();
_htmlFormatMsgLinkTemplateHashtag.removeAttribute('id');
}
});
// format "userpost" to html element