ui._detectScrollSize

webix.ui._detectScrollSize([see official doc])

webix.ui._detectScrollSize helper.

Please look into the linked official documentation.

References

helpers
skin(), set().

Referenced by

helpers
scrollSize().

External references

Official documentation page.

Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
webix.ui._detectScrollSize = function(){
    var div = webix.html.create("div");
    div.className = "webix_skin_mark";
    div.style.cssText="position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;min-height:100px;overflow-y:scroll;";

    document.body.appendChild(div);
    var width = div.offsetWidth-div.clientWidth;
    var skin = { 110:"air", 120:"aircompact", 130:"clouds", 140:"web", 150:"terrace", 160:"metro", 170:"light", 180:"glamour", 190:"touch", 200:"flat" , 210:"compact", 220:"material", 230: "contrast" }[Math.floor(div.offsetHeight/10)*10];
    document.body.removeChild(div);

    if (skin){
        var skinobj = webix.skin[skin];
        if (skinobj && skinobj != webix.skin.$active)
            webix.skin.set(skin);
    }

    if (webix.env.$customScroll) return 0;
    return width;
};