dialog position fixed
This commit is contained in:
		
							parent
							
								
									534661f643
								
							
						
					
					
						commit
						e3c2826183
					
				| 
						 | 
					@ -12,7 +12,7 @@
 | 
				
			||||||
    "Theme": "default",
 | 
					    "Theme": "default",
 | 
				
			||||||
    "Created": 1414080000000000000,
 | 
					    "Created": 1414080000000000000,
 | 
				
			||||||
    "Updated": 1414080000000000000,
 | 
					    "Updated": 1414080000000000000,
 | 
				
			||||||
    "Lived": 1414080000000000000,
 | 
					    "Lived": 1422433217150692000,
 | 
				
			||||||
    "Editor": {
 | 
					    "Editor": {
 | 
				
			||||||
        "FontFamily": "Consolas, 'Courier New', monospace",
 | 
					        "FontFamily": "Consolas, 'Courier New', monospace",
 | 
				
			||||||
        "FontSize": "13px",
 | 
					        "FontSize": "13px",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,6 +19,7 @@
 | 
				
			||||||
    line-height: 28px;
 | 
					    line-height: 28px;
 | 
				
			||||||
    white-space: normal;
 | 
					    white-space: normal;
 | 
				
			||||||
    word-wrap: break-word;
 | 
					    word-wrap: break-word;
 | 
				
			||||||
 | 
					    overflow: auto;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#startPage a {
 | 
					#startPage a {
 | 
				
			||||||
| 
						 | 
					@ -65,7 +66,6 @@
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#startPage .news {
 | 
					#startPage .news {
 | 
				
			||||||
    height: 300px;
 | 
					 | 
				
			||||||
    width: 60%;
 | 
					    width: 60%;
 | 
				
			||||||
    float: right;
 | 
					    float: right;
 | 
				
			||||||
    border-left: 1px solid #f1f1f1;
 | 
					    border-left: 1px solid #f1f1f1;
 | 
				
			||||||
| 
						 | 
					@ -80,4 +80,6 @@
 | 
				
			||||||
#startPage .date {
 | 
					#startPage .date {
 | 
				
			||||||
    color: #bbb;
 | 
					    color: #bbb;
 | 
				
			||||||
    font-size: 13px;
 | 
					    font-size: 13px;
 | 
				
			||||||
 | 
					    word-wrap: normal;
 | 
				
			||||||
 | 
					    white-space: nowrap;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -135,25 +135,6 @@
 | 
				
			||||||
            $($("#" + id + "Dialog ." + styleClass.main + " div").get(0)).append(cloneObj);
 | 
					            $($("#" + id + "Dialog ." + styleClass.main + " div").get(0)).append(cloneObj);
 | 
				
			||||||
            $(cloneObj).show();
 | 
					            $(cloneObj).show();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Sets position.
 | 
					 | 
				
			||||||
            var top = "", left = "",
 | 
					 | 
				
			||||||
                    $dialog = $("#" + id + "Dialog");
 | 
					 | 
				
			||||||
            if (settings.position) {
 | 
					 | 
				
			||||||
                top = settings.position.top;
 | 
					 | 
				
			||||||
                left = settings.position.left;
 | 
					 | 
				
			||||||
            } else {
 | 
					 | 
				
			||||||
                // 20(footer) + 23(header)
 | 
					 | 
				
			||||||
                top = parseInt((windowH - dialogH - 43) / 2);
 | 
					 | 
				
			||||||
                if (top < 0) {
 | 
					 | 
				
			||||||
                    top = 0;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                left = parseInt((windowW - dialogW) / 2);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            $dialog.css({
 | 
					 | 
				
			||||||
                "top": top + "px",
 | 
					 | 
				
			||||||
                "left": left + "px"
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            // Bind event.
 | 
					            // Bind event.
 | 
				
			||||||
            $("#" + id + "Dialog ." + styleClass.closeIcon).bind("click", function () {
 | 
					            $("#" + id + "Dialog ." + styleClass.closeIcon).bind("click", function () {
 | 
				
			||||||
                $.dialog._close(id, settings);
 | 
					                $.dialog._close(id, settings);
 | 
				
			||||||
| 
						 | 
					@ -263,9 +244,30 @@
 | 
				
			||||||
        _openDialog: function (target, msg) {
 | 
					        _openDialog: function (target, msg) {
 | 
				
			||||||
            var inst = this._getInst(target);
 | 
					            var inst = this._getInst(target);
 | 
				
			||||||
            var id = inst.id,
 | 
					            var id = inst.id,
 | 
				
			||||||
                    settings = inst.settings;
 | 
					                    settings = inst.settings,
 | 
				
			||||||
 | 
					                    top = "", left = "",
 | 
				
			||||||
 | 
					                    $dialog = $("#" + id + "Dialog"),
 | 
				
			||||||
 | 
					                    windowH = $(window).height(),
 | 
				
			||||||
 | 
					                    windowW = $(window).width(),
 | 
				
			||||||
 | 
					                    dialogH = settings.height ? settings.height : parseInt(windowH * 0.6),
 | 
				
			||||||
 | 
					                    dialogW = settings.width ? settings.width : parseInt(windowW * 0.6);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $("#" + id + "Dialog").show();
 | 
					            // Sets position.
 | 
				
			||||||
 | 
					            if (settings.position) {
 | 
				
			||||||
 | 
					                top = settings.position.top;
 | 
				
			||||||
 | 
					                left = settings.position.left;
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                // 20(footer) + 23(header)
 | 
				
			||||||
 | 
					                top = parseInt((windowH - dialogH - 43) / 2);
 | 
				
			||||||
 | 
					                if (top < 0) {
 | 
				
			||||||
 | 
					                    top = 0;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                left = parseInt((windowW - dialogW) / 2);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            $dialog.css({
 | 
				
			||||||
 | 
					                "top": top + "px",
 | 
				
			||||||
 | 
					                "left": left + "px"
 | 
				
			||||||
 | 
					            }).show();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (settings.modal) {
 | 
					            if (settings.modal) {
 | 
				
			||||||
                var styleClass = this._getDefaults($.dialog._defaults, settings, "styleClass");
 | 
					                var styleClass = this._getDefaults($.dialog._defaults, settings, "styleClass");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -272,6 +272,7 @@ var editors = {
 | 
				
			||||||
                    + '"><span class="ico-start font-ico"></span> ' + config.label.start_page + '</span>',
 | 
					                    + '"><span class="ico-start font-ico"></span> ' + config.label.start_page + '</span>',
 | 
				
			||||||
            content: '<div id="startPage"></div>',
 | 
					            content: '<div id="startPage"></div>',
 | 
				
			||||||
            after: function () {
 | 
					            after: function () {
 | 
				
			||||||
 | 
					                $("#startPage").height($('.side-right').height() - $(".bottom-window-group").children(".tabs").height() - 100);
 | 
				
			||||||
                $("#startPage").load(config.context + '/start?sid=' + config.wideSessionId);
 | 
					                $("#startPage").load(config.context + '/start?sid=' + config.wideSessionId);
 | 
				
			||||||
                $.ajax({
 | 
					                $.ajax({
 | 
				
			||||||
                    url: "https://symphony.b3log.org/apis/articles?tags=wide,golang&p=1&size=30",
 | 
					                    url: "https://symphony.b3log.org/apis/articles?tags=wide,golang&p=1&size=30",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -379,6 +379,8 @@ var wide = {
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            $(".side-right > .tabs-panel > div").height($('.side-right').height() - $bottomGroup.children(".tabs").height());
 | 
					            $(".side-right > .tabs-panel > div").height($('.side-right').height() - $bottomGroup.children(".tabs").height());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $("#startPage").height($('.side-right').height() - $bottomGroup.children(".tabs").height() - 100);
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    _initWS: function () {
 | 
					    _initWS: function () {
 | 
				
			||||||
        var outputWS = new ReconnectingWebSocket(config.channel + '/output/ws?sid=' + config.wideSessionId);
 | 
					        var outputWS = new ReconnectingWebSocket(config.channel + '/output/ws?sid=' + config.wideSessionId);
 | 
				
			||||||
| 
						 | 
					@ -490,7 +492,7 @@ var wide = {
 | 
				
			||||||
        // 点击隐藏弹出层
 | 
					        // 点击隐藏弹出层
 | 
				
			||||||
        $("body").bind("mouseup", function (event) {
 | 
					        $("body").bind("mouseup", function (event) {
 | 
				
			||||||
            //fix issue#200 右键文件树失效
 | 
					            //fix issue#200 右键文件树失效
 | 
				
			||||||
	  if (event.which == 3) {
 | 
					            if (event.which === 3) {
 | 
				
			||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            $(".frame").hide();
 | 
					            $(".frame").hide();
 | 
				
			||||||
| 
						 | 
					@ -524,7 +526,6 @@ var wide = {
 | 
				
			||||||
            for (var i = 0, ii = editorDatas.length; i < ii; i++) {
 | 
					            for (var i = 0, ii = editorDatas.length; i < ii; i++) {
 | 
				
			||||||
                editorDatas[i].editor.setSize("100%", height);
 | 
					                editorDatas[i].editor.setSize("100%", height);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    _save: function (path, editor) {
 | 
					    _save: function (path, editor) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -170,6 +170,7 @@ var windows = {
 | 
				
			||||||
                editorDatas[i].editor.setSize("100%", height);
 | 
					                editorDatas[i].editor.setSize("100%", height);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $("#startPage").height(height - 100);
 | 
				
			||||||
            $it.show();
 | 
					            $it.show();
 | 
				
			||||||
            $(".footer .ico-restore:eq(1)").hide();
 | 
					            $(".footer .ico-restore:eq(1)").hide();
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
| 
						 | 
					@ -225,7 +226,7 @@ var windows = {
 | 
				
			||||||
        for (var i = 0, ii = editorDatas.length; i < ii; i++) {
 | 
					        for (var i = 0, ii = editorDatas.length; i < ii; i++) {
 | 
				
			||||||
            editorDatas[i].editor.setSize("100%", height);
 | 
					            editorDatas[i].editor.setSize("100%", height);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        $("#startPage").height(height - 100);
 | 
				
			||||||
        $(".bottom-window-group").css("top", "100%").hide();
 | 
					        $(".bottom-window-group").css("top", "100%").hide();
 | 
				
			||||||
        $(".footer .ico-restore:eq(1)").show();
 | 
					        $(".footer .ico-restore:eq(1)").show();
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue