ui._popups¶
webix.ui.
_popups
([see official doc])¶webix.ui._popups helper.
Please look into the linked official documentation.
References¶
Referenced by¶
- helpers
destructors()
.- views
window()
.
External references¶
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | webix.ui._popups = webix.toArray();
webix.extend(webix.ui.window, {
resize_setter:function(value){
if (value && !this._resizeHandlers)
this._renderResizeHandler();
return value;
},
_renderResizeHandler: function(){
if(!this._rwHandle){
this._viewobj.firstChild.style.position = "relative";
this._rwHandle = webix.html.create("DIV",{
"class" : "webix_resize_handle"
});
this._viewobj.firstChild.appendChild(this._rwHandle);
webix._event(this._rwHandle, webix.env.mouse.down, this._wrDown, {bind:this});
}
},
_showResizeFrame: function(width,height){
if(!this._resizeFrame){
this._resizeFrame = webix.html.create("div", {"class":"webix_resize_frame"},"");
document.body.appendChild(this._resizeFrame);
var pos = webix.html.offset(this._viewobj);
this._resizeFrame.style.left = pos.x+"px";
this._resizeFrame.style.top = pos.y+"px";
this._resizeFrame.style.zIndex = webix.ui.zIndex();
}
this._resizeFrame.style.width = width + "px";
this._resizeFrame.style.height = height + "px";
},
_wrDown:function(e){
if (this.config.resize){
webix.html.addCss(document.body,"webix_noselect webix_resize_cursor");
this._wsReady = webix.html.offset(this._viewobj);
this._resizeHandlersMove = webix.event(document.body, webix.env.mouse.move, this._wrMove, {bind:this});
this._resizeHandlersUp = webix.event(document.body, webix.env.mouse.up, this._wrUp, {bind:this});
}
},
_wrMove:function(e){
if (this._wsReady !== false){
var pos = webix.html.pos(e);
var progress = {x:pos.x - this._wsReady.x+10, y: pos.y - this._wsReady.y+10};
if (Math.abs(this._wsReady.x - pos.x) < (this.config.minWidth||100) || Math.abs(this._wsReady.y - pos.y) < (this.config.maxHeight||100))
return;
this._wsProgress = progress;
this._showResizeFrame(progress.x,progress.y);
}
},
_wrUp:function(){
// remove resize frame and css styles
if (this._resizeFrame)
this._resizeFrame = webix.html.remove(this._resizeFrame);
webix.html.removeCss(document.body,"webix_resize_cursor");
webix.html.removeCss(document.body,"webix_noselect");
webix.eventRemove(this._resizeHandlersMove);
webix.eventRemove(this._resizeHandlersUp);
// set Window sizes
if (this._wsProgress){
this.config.width = this._wsProgress.x;
this.config.height = this._wsProgress.y;
this.resize();
}
this._wsReady = this._wsProgress = false;
this.callEvent("onViewResize",[]);
}
});
|