This is a migrated thread and some comments may be shown as answers.

Image Browser Bug when adding new folder

1 Answer 68 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Terry Harrison
Top achievements
Rank 1
Terry Harrison asked on 02 Nov 2013, 11:47 PM
I am using the image browser (from the editor) and it works just fine as long as the amount of items in the current folder is small. If you add a new folder and the number of items in the current window alphabetically means that a new entry with a name of New Folder requires a scroll down to find it there is a problem. The scroll action causes the Create Command to be executed and a New Folder is created without letting the user name the folder. Once the folder is named there is no way that I can find to rename a folder. This is a big limitation for an otherwise elegant control. 

Is there some way to make the created New Folder appear at the top of the window or am I missing something. I have found that once you click the Add Folder button, if you click any key on the keyboard it will enter that value plus take you to the new folder without posting the name to the server. Then you can change the name, click Enter and the folder will be named what you want. This is extremely awkward and almost impossible to explain to a user. 

Can someone tell me a way around this issue please?

Terry

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 04 Nov 2013, 03:00 PM
Hello Terry,

Indeed, this is a current limitation of the ImageBrowser. You can workaround it by subscribing to the "Add New Folder" button's click event (after the ImageBrowser has been opened) and scroll manually:


$(".k-insertImage").click(function(){
    setTimeout(function(){
        $(".k-addfolder").parent().on("click", function(){
            var listview = $(".k-listview.k-floats");
            setTimeout(function(){
                listview.scrollTop(listview.find(".k-state-selected").position().top);
            }, 1);
        });
    }, 1);
});


The above code does not include any foolproof checks, e.g. so that it targets a particular Editor instance. Feel free to add some, if required.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Editor
Asked by
Terry Harrison
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or