fix (js): ошибки в логике

parent 0fab9e94
/* Add here all your JS customizations */ /* Add here all your JS customizations */
BX.addCustomEvent("onSubmitForm", BX.delegate(function (data) { BX.addCustomEvent("onSubmitForm", BX.delegate(function (data) {
if (!data.type || data.type !== 'form_submit'){ if ( !window.ym || !data.type || data.type !== 'form_submit'){
return; return;
} }
if (data.form_name && data.form_name === 'aspro_scorp_callback' ) { if (data.form_name && data.form_name === 'aspro_scorp_callback' ) {
...@@ -16,11 +16,15 @@ BX.addCustomEvent("onSubmitForm", BX.delegate(function (data) { ...@@ -16,11 +16,15 @@ BX.addCustomEvent("onSubmitForm", BX.delegate(function (data) {
document.addEventListener('DOMContentLoaded', readMore); document.addEventListener('DOMContentLoaded', readMore);
function readMore(){ function readMore(){
const block = document.querySelector('[data-text=root]'); const block = document.querySelector('[data-text=root]');
if ( block === null ) {
return;
}
const content = block.querySelector('[data-text=content]'); const content = block.querySelector('[data-text=content]');
const button = block.querySelector('[data-text=button]'); const button = block.querySelector('[data-text=button]');
const maxHeightContent = 160; const maxHeightContent = 160;
if(!block || !content || !button){ if( !content || !button){
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment