view

class webix.ui.view(data)
Arguments:
  • data (object) – A configuration object

View view.

References

views
baseview().
helpers
debug_size_box(), isUndefined(), protoUI().

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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
webix.protoUI({
    name:"view",
    $init:function(config){
        this._set_inner(config);
    },

    //deside, will component use borders or not
    _set_inner:function(config){
        var border_not_set = webix.isUndefined(config.borderless);
        if (border_not_set && !this.setPosition && config.$topView){
            config.borderless = true;
            border_not_set = false;
        }

        if ((border_not_set && this.defaults.borderless) || config.borderless){
            //button and custom borderless
            config._inner = { top:true, left:true, bottom:true, right:true };
        } else {
            //default borders
            if (!config._inner)
                config._inner = {};
            this._contentobj.style.borderWidth="1px";
        }
    },

    $getSize:function(dx, dy){

        var _borders = this._settings._inner;
        if (_borders){
            dx += (_borders.left?0:1)+(_borders.right?0:1);
            dy += (_borders.top?0:1)+(_borders.bottom?0:1);
        }

        var size = webix.ui.baseview.prototype.$getSize.call(this, dx, dy);

        webix.debug_size_box(this, size, true);
        return size;
    },
    $setSize:function(x,y){
        webix.debug_size_box(this, [x,y]);

        var _borders = this._settings._inner;
        if (_borders){
            x -= (_borders.left?0:1)+(_borders.right?0:1);
            y -= (_borders.top?0:1)+(_borders.bottom?0:1);
        }

        return webix.ui.baseview.prototype.$setSize.call(this,x,y);
    }
}, webix.ui.baseview);

})();

webix.ui.view.call(webix);