Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/themify-.../js/editor/modules
File: tab.mjs
[500] Fix | Delete
return {tabTitleWrap,tabContent};
[501] Fix | Delete
}
[502] Fix | Delete
preview(data){
[503] Fix | Delete
const color = data.color_tab && data.color_tab!=='default'?data.color_tab:'tb_default_color',
[504] Fix | Delete
{layout_tab:layout= 'minimal',tab_content_tab:arr=[]}=data,
[505] Fix | Delete
module=createElement(),
[506] Fix | Delete
currentActiveWrap=createElement('','tab-nav-current-active tf_hide'),
[507] Fix | Delete
burgerIcon=createElement('span','tab_burger_icon tf_rel'),
[508] Fix | Delete
tabNav=createElement('ul','tab-nav tf_clearfix'),
[509] Fix | Delete
classes=['module','module-tab','ui'],
[510] Fix | Delete
checkClass=[layout,color,data.css_tab];
[511] Fix | Delete
if(data.style_tab){
[512] Fix | Delete
classes.push('tab-style-'+data.style_tab);
[513] Fix | Delete
}
[514] Fix | Delete
if(data.tab_appearance_tab){
[515] Fix | Delete
checkClass[data.tab_appearance_tab.split('|').join(' ')];
[516] Fix | Delete
}
[517] Fix | Delete
for(let i=0;i<checkClass.length;++i){
[518] Fix | Delete
if(checkClass[i]){
[519] Fix | Delete
classes.push(checkClass[i]);
[520] Fix | Delete
}
[521] Fix | Delete
}
[522] Fix | Delete
module.className=classes.join(' ');
[523] Fix | Delete
if('allow_tab' === data.allow_tab_breakpoint && '' !== data.tab_breakpoint){
[524] Fix | Delete
module.dataset.tabBreakpoint=data.tab_breakpoint;
[525] Fix | Delete
}
[526] Fix | Delete
[527] Fix | Delete
currentActiveWrap.append(
[528] Fix | Delete
burgerIcon,
[529] Fix | Delete
this.constructor._setEditableContent(createElement('span','tb_tab_title'),'title_tab',arr[0]?.title_tab,'','tab_content_tab',0)
[530] Fix | Delete
);
[531] Fix | Delete
[532] Fix | Delete
if(data.mod_title_tab){
[533] Fix | Delete
module.appendChild(this.constructor.getModuleTitle(data.mod_title_tab,'mod_title_tab'));
[534] Fix | Delete
}
[535] Fix | Delete
module.append(currentActiveWrap,tabNav);
[536] Fix | Delete
if(api.activeModel?.id===this.id && !isRestore){
[537] Fix | Delete
this.parseHtml(data);
[538] Fix | Delete
}
[539] Fix | Delete
module.tfOn(_CLICK_,e=>{
[540] Fix | Delete
const target=e.target,
[541] Fix | Delete
cl=target?.classList;
[542] Fix | Delete
if(cl.contains('tb_add_tab') || cl.contains('tb_del_tab')){
[543] Fix | Delete
e.stopPropagation();
[544] Fix | Delete
if(cl.contains('tb_add_tab')){
[545] Fix | Delete
if(api.activeModel?.id===this.id){
[546] Fix | Delete
Themify.triggerEvent(api.LightBox.el.tfClass('add_new')[0],e.type);
[547] Fix | Delete
}
[548] Fix | Delete
else{
[549] Fix | Delete
api.undoManager.start('inlineAdd');
[550] Fix | Delete
const settings=this.get('mod_settings'),
[551] Fix | Delete
ul=this.el.tfClass('tab-nav')[0],
[552] Fix | Delete
def=this.constructor.default().tab_content_tab?.[0] || {};
[553] Fix | Delete
settings.tab_content_tab??=[];
[554] Fix | Delete
const index=settings.tab_content_tab.push(def),
[555] Fix | Delete
{tabTitleWrap,tabContent}=this._getItem(def,settings,index);
[556] Fix | Delete
tabTitleWrap.appendChild(target);
[557] Fix | Delete
ul.appendChild(tabTitleWrap);
[558] Fix | Delete
ul.parentNode.appendChild(tabContent);
[559] Fix | Delete
this.set('mod_settings',settings);
[560] Fix | Delete
api.undoManager.end('inlineAdd');
[561] Fix | Delete
}
[562] Fix | Delete
}
[563] Fix | Delete
else{
[564] Fix | Delete
const li=target.closest('li'),
[565] Fix | Delete
index=Themify.convert(li.parentNode.children).indexOf(li);
[566] Fix | Delete
if(index!==-1){
[567] Fix | Delete
if(api.activeModel?.id===this.id){
[568] Fix | Delete
Themify.triggerEvent(api.LightBox.el.tfClass('tb_delete_row')[index],e.type);
[569] Fix | Delete
}
[570] Fix | Delete
else{
[571] Fix | Delete
api.undoManager.start('inlineDelete');
[572] Fix | Delete
const settings=this.get('mod_settings'),
[573] Fix | Delete
id=li.tfTag('a')[0].getAttribute('href'),
[574] Fix | Delete
addBtn=li.tfClass('tb_add_btn')[0],
[575] Fix | Delete
content=this.el.querySelector('[data-id="'+id.replace('#','')+'"]');
[576] Fix | Delete
settings.tab_content_tab.splice(index, 1);
[577] Fix | Delete
this.set('mod_settings',settings);
[578] Fix | Delete
if(addBtn){
[579] Fix | Delete
li.previousElementSibling?.appendChild(addBtn);
[580] Fix | Delete
}
[581] Fix | Delete
content.remove();
[582] Fix | Delete
li.remove();
[583] Fix | Delete
api.undoManager.end('inlineDelete');
[584] Fix | Delete
}
[585] Fix | Delete
}
[586] Fix | Delete
}
[587] Fix | Delete
}
[588] Fix | Delete
},{passive:true});
[589] Fix | Delete
[590] Fix | Delete
[591] Fix | Delete
for(let i=0,len=arr.length;i<len;++i){
[592] Fix | Delete
let {tabTitleWrap,tabContent}=this._getItem(arr[i],data, i);
[593] Fix | Delete
if((len -1)===i){
[594] Fix | Delete
tabTitleWrap.appendChild(createElement('',{role:'button',class:'tb_add_btn tb_add_tab tf_plus_icon tb_disable_sorting',title:'Add Tab'}));
[595] Fix | Delete
}
[596] Fix | Delete
tabNav.appendChild(tabTitleWrap);
[597] Fix | Delete
module.appendChild(tabContent);
[598] Fix | Delete
}
[599] Fix | Delete
return module;
[600] Fix | Delete
}
[601] Fix | Delete
};
[602] Fix | Delete
})(tb_app);
[603] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function