Skip to content

Commit

Permalink
Closes #5282: DJE duplicates ID with elementor recommended exclusions (
Browse files Browse the repository at this point in the history
…#5876)

* Added check to counter ID duplication

* Fixed failed test

* Create element with unique id

* Updated test

* Updated failed test fixture

* Updated failed test fixture again

---------

Co-authored-by: Vasilis Manthos <vmanthos@gmail.com>
  • Loading branch information
jeawhanlee and vmanthos committed May 10, 2023
1 parent 408433f commit fb51371
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/js/elementor-animation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
$fix_script = "class RocketElementorAnimation{constructor(){this.deviceMode=document.createElement(\"span\"),this.deviceMode.id=\"elementor-device-mode\",this.deviceMode.setAttribute(\"class\",\"elementor-screen-only\"),document.body.appendChild(this.deviceMode)}_detectAnimations(){let t=getComputedStyle(this.deviceMode,\":after\").content.replace(/\"/g,\"\");this.animationSettingKeys=this._listAnimationSettingsKeys(t),document.querySelectorAll(\".elementor-invisible[data-settings]\").forEach(t=>{const e=t.getBoundingClientRect();if(e.bottom>=0&&e.top<=window.innerHeight)try{this._animateElement(t)}catch(t){}})}_animateElement(t){const e=JSON.parse(t.dataset.settings),i=e._animation_delay||e.animation_delay||0,n=e[this.animationSettingKeys.find(t=>e[t])];if(\"none\"===n)return void t.classList.remove(\"elementor-invisible\");t.classList.remove(n),this.currentAnimation&&t.classList.remove(this.currentAnimation),this.currentAnimation=n;let s=setTimeout(()=>{t.classList.remove(\"elementor-invisible\"),t.classList.add(\"animated\",n),this._removeAnimationSettings(t,e)},i);window.addEventListener(\"rocket-startLoading\",function(){clearTimeout(s)})}_listAnimationSettingsKeys(t=\"mobile\"){const e=[\"\"];switch(t){case\"mobile\":e.unshift(\"_mobile\");case\"tablet\":e.unshift(\"_tablet\");case\"desktop\":e.unshift(\"_desktop\")}const i=[];return[\"animation\",\"_animation\"].forEach(t=>{e.forEach(e=>{i.push(t+e)})}),i}_removeAnimationSettings(t,e){this._listAnimationSettingsKeys().forEach(t=>delete e[t]),t.dataset.settings=JSON.stringify(e)}static run(){const t=new RocketElementorAnimation;requestAnimationFrame(t._detectAnimations.bind(t))}}document.addEventListener(\"DOMContentLoaded\",RocketElementorAnimation.run);";
$fix_script = "class RocketElementorAnimation{constructor(){this.deviceMode=document.createElement(\"span\"),this.deviceMode.id=\"elementor-device-mode-wpr\",this.deviceMode.setAttribute(\"class\",\"elementor-screen-only\"),document.body.appendChild(this.deviceMode)}_detectAnimations(){let t=getComputedStyle(this.deviceMode,\":after\").content.replace(/\"/g,\"\");this.animationSettingKeys=this._listAnimationSettingsKeys(t),document.querySelectorAll(\".elementor-invisible[data-settings]\").forEach(t=>{const e=t.getBoundingClientRect();if(e.bottom>=0&&e.top<=window.innerHeight)try{this._animateElement(t)}catch(t){}})}_animateElement(t){const e=JSON.parse(t.dataset.settings),i=e._animation_delay||e.animation_delay||0,n=e[this.animationSettingKeys.find(t=>e[t])];if(\"none\"===n)return void t.classList.remove(\"elementor-invisible\");t.classList.remove(n),this.currentAnimation&&t.classList.remove(this.currentAnimation),this.currentAnimation=n;let s=setTimeout(()=>{t.classList.remove(\"elementor-invisible\"),t.classList.add(\"animated\",n),this._removeAnimationSettings(t,e)},i);window.addEventListener(\"rocket-startLoading\",function(){clearTimeout(s)})}_listAnimationSettingsKeys(t=\"mobile\"){const e=[\"\"];switch(t){case\"mobile\":e.unshift(\"_mobile\");case\"tablet\":e.unshift(\"_tablet\");case\"desktop\":e.unshift(\"_desktop\")}const i=[];return[\"animation\",\"_animation\"].forEach(t=>{e.forEach(e=>{i.push(t+e)})}),i}_removeAnimationSettings(t,e){this._listAnimationSettingsKeys().forEach(t=>delete e[t]),t.dataset.settings=JSON.stringify(e)}static run(){const t=new RocketElementorAnimation;requestAnimationFrame(t._detectAnimations.bind(t))}}document.addEventListener(\"DOMContentLoaded\",RocketElementorAnimation.run);";

return [
'vfs_dir' => 'wp-content/',
Expand Down

0 comments on commit fb51371

Please sign in to comment.