1
Toggle a class on html or body tag when FileUltimate is visible or not
Idea shared by Alexandre Boucher - 2/22/2017 at 7:13 AM
Proposed
I am currently using FileUltimate as a File Chooser, using the following code :
var fileManager = new FileManager
{
                Resizable = false,
                DisplayLanguage = "fr",
                ShowOnLoad = false,
                FullViewport = true,
                ModalDialog = true,
                ModalDialogTitle = modalTitle,
                ID = id,
                SortRootFolders = false,
                Chooser = isChooser,
                ChooserType = FileManagerChooserType.File,
                ChooserMultipleSelection = isMultiselectChooser,
                ShowRibbon = !isChooser,
                ClientChosen = "fileManagerChosen",
                ClientLoading = "fileManagerLoading"
};
Problem is, since the FileUltimate is hidden on load and as soon as I load FileUltimate scripts in the page, x-body, x-viewport and classes like that start to appear on the html and body tags. There is also a overflow: hidden style set on the body element as soon as the scripts and styles load. For my usage, I need the body not to be overflow: hidden, so I wrote a style overwriting it. Problem is, when I actually show the FileUltimate control, I would need to put this style (overflow: hidden) back, to prevent scrolling in the page.
 
Sure I can intercept the javascript show() function call and add a class on the body element to remove my other style. However, I also need to remove this overflow: hidden once the FileUltimate control is closed. Is it possible to intercept an event when the FileUltimate chooser is closed, or otherwise set a specific class on the body element when it is visible and remove it when it is hidden?
 
Thank you!

Reply to Thread