|
发表于 2017-6-9 15:46:06
|
显示全部楼层
那就需要自己在页面中设置一块区域,自己控制在个区域中拖拽可以移动,移动的实现可以参考/UI2/system/components/justep/dialog/dialog.js中实现
- _dragStart: function(evt){
- if (this._canMove()){
- var target = evt.target;
- if(!$(target).is('button.close') && !$(target).parent().is('button.close')){
- this.$domNode.addClass('x-dialog-drag');
- this._moving = true;
- this._createDragContext(evt);
- }
- }
- },
- _canMove: function(){
- return this.status != 'maximize';
- },
- _dragMove: function(evt){
- if(this._moving && this._dragContext){
- var left = evt.clientX - this._dragContext.x + this._dragContext.dlg.left;
- var top = evt.clientY - this._dragContext.y + this._dragContext.dlg.top;
- this._getDialogNode().offset({top:top,left:left});
- this._moved = true;
- }
- },
- _dragEnd: function(evt){
- this.$domNode.removeClass('x-dialog-drag');
- this._moving = false;
- this._clsDragContext();
- },
复制代码 |
|