Mohammed Nasman Posted July 22, 2025 Posted July 22, 2025 Hello, I used this code inside CustomCSS in ServerModule to change mask message to image : .x-mask-msg{ background:none; border-width:0px; } .x-mask-msg-inner{ border-width:0px; color:none; padding:50px; background: rgba(0, 0, 0, 0); background-image:url(files/loading.gif); background-repeat:no-repeat; background-size: contain; } .x-mask-msg-text{ display:none; background-image:none; } Can i change it from image to text at runtime ? Thanks. Quote
Sherzod Posted July 22, 2025 Posted July 22, 2025 Hello, 36 minutes ago, Mohammed Nasman said: Can i change it from image to text at runtime ? Solution: 1. MainForm.Script -> function setMaskImage() { if (!document.getElementById('customMaskStyle')) { var sheet = document.createElement('style'); sheet.innerHTML = ".x-mask-msg {\ background: none !important;\ border-width: 0px !important;\ }\ .x-mask-msg-inner {\ background: rgba(0,0,0,0) !important;\ background-image: url(files/loading.gif) !important;\ background-repeat: no-repeat !important;\ background-size: contain !important;\ padding: 50px !important;\ }\ .x-mask-msg-text {\ display: none !important;\ }"; sheet.id = "customMaskStyle"; document.head.appendChild(sheet); } } function restoreMaskText() { var custom = document.getElementById('customMaskStyle'); if (custom) custom.remove(); } setMaskImage(); //Call setMaskImage() to apply the image mask right away. 2. Usage: setMaskImage(); // Switches mask to show an image instead of text restoreMaskText(); // Restores the default mask with text 1 Quote
Mohammed Nasman Posted July 22, 2025 Author Posted July 22, 2025 1 hour ago, Sherzod said: Hello, Solution: 1. MainForm.Script -> function setMaskImage() { if (!document.getElementById('customMaskStyle')) { var sheet = document.createElement('style'); sheet.innerHTML = ".x-mask-msg {\ background: none !important;\ border-width: 0px !important;\ }\ .x-mask-msg-inner {\ background: rgba(0,0,0,0) !important;\ background-image: url(files/loading.gif) !important;\ background-repeat: no-repeat !important;\ background-size: contain !important;\ padding: 50px !important;\ }\ .x-mask-msg-text {\ display: none !important;\ }"; sheet.id = "customMaskStyle"; document.head.appendChild(sheet); } } function restoreMaskText() { var custom = document.getElementById('customMaskStyle'); if (custom) custom.remove(); } setMaskImage(); //Call setMaskImage() to apply the image mask right away. 2. Usage: setMaskImage(); // Switches mask to show an image instead of text restoreMaskText(); // Restores the default mask with text Thanks, it works! 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.