diff --git a/plugins-client/ext.dockpanel/dockpanel.js b/plugins-client/ext.dockpanel/dockpanel.js index 421d63440..27a16abbb 100644 --- a/plugins-client/ext.dockpanel/dockpanel.js +++ b/plugins-client/ext.dockpanel/dockpanel.js @@ -412,7 +412,10 @@ module.exports = ext.register("ext/dockpanel/dockpanel", { }, expandBar : function(bar){ - this.layout.expandBar(bar.cache); + if (bar.cache) + this.layout.expandBar(bar.cache); + else if (bar.uniqueId != null) + this.layout.expandBar(bar.uniqueId); }, //@todo removal of pages diff --git a/plugins-client/ext.dockpanel/libdock.js b/plugins-client/ext.dockpanel/libdock.js index 6167346f2..a540e36ec 100644 --- a/plugins-client/ext.dockpanel/libdock.js +++ b/plugins-client/ext.dockpanel/libdock.js @@ -666,12 +666,18 @@ var DockableLayout = module.exports = function(parentHBox, cbFindPage, cbStorePa if (!bar.vbox) { var _self = this; - if (bar.$dockData.minWidth) - pNode.minwidth = bar.$dockData.minWidth; + var dockMinWidthVal = bar.$dockData.minWidth || bar.$dockData["min-width"]; + if (dockMinWidthVal) + pNode.minwidth = dockMinWidthVal; + + var dockWidth = bar.$dockData && bar.$dockData.width || 260; + var dockMinWidth = dockMinWidthVal || 0; + if (dockMinWidth && dockWidth < dockMinWidth) + dockWidth = dockMinWidth; bar.vbox = pNode.insertBefore(new ppc.vbox({ padding : 0, - width : bar.$dockData && bar.$dockData.width || 260, + width : dockWidth, splitters : true, vdock : 1, "class" : "dockcol unselectable expandedpanel", @@ -772,6 +778,12 @@ var DockableLayout = module.exports = function(parentHBox, cbFindPage, cbStorePa } if (bar.vbox) { + // Enforce min-width on the vbox — always set if width is too small + var minW = bar.$dockData && (bar.$dockData.minWidth || bar.$dockData["min-width"]); + var curW = bar.vbox.getWidth ? bar.vbox.getWidth() : 0; + if (minW && (!curW || curW < minW)) + bar.vbox.setWidth(minW); + bar.vbox.show(); bar.vbox.expanded = true; bar.vbox.firstChild.$ext.onmousemove({}); diff --git a/plugins-client/ext.main/style/skins.xml b/plugins-client/ext.main/style/skins.xml index 1a14c0d86..9fd11aedc 100644 --- a/plugins-client/ext.main/style/skins.xml +++ b/plugins-client/ext.main/style/skins.xml @@ -4093,7 +4093,7 @@ } .datagrid .headings div{ - display : -moz-inline-box; + display : inline-block; overflow : visible; position : relative; } @@ -4102,7 +4102,7 @@ } .datagrid .records .row span{ - display : -moz-inline-box; + display : inline-block; overflow : visible; position : relative; } @@ -4623,7 +4623,7 @@ } .dgcheck .headings div{ - display : -moz-inline-box; + display : inline-block; overflow : visible; position : relative; } @@ -4632,7 +4632,7 @@ } .dgcheck .records .row span{ - display : -moz-inline-box; + display : inline-block; overflow : visible; position : relative; } @@ -6682,7 +6682,7 @@ ]]> .sbios{ - display : -webkit-box; + display : flex; } .sbios span{ @@ -8055,7 +8055,7 @@ ]]> .console_scrollbar{ - display : -webkit-box; + display : flex; } .console_scrollbar span{ @@ -8779,8 +8779,7 @@ z-index : 90000; background-color: #e8e8e8; - display : -webkit-box; - display : -ms-box; + display : flex; } .w-resize { @@ -9314,7 +9313,7 @@ right : 0; clip: rect(0px 4000px 30px 0px); - display : -webkit-box; + display : flex; } .tab_console .btncontainer > .btntab { @@ -9322,7 +9321,7 @@ min-width : 17px; max-width : 70px; - -webkit-box-flex : 1; + flex : 1; position : relative; width : 0; @@ -9543,7 +9542,7 @@ /*box-shadow: 0 -1px 0 0 black inset, 0 1px 0 0 rgba(255, 255, 255, .06) inset;*/ margin-bottom: 1px; - display : -webkit-box; + display : flex; } .editor_tab .btnsesssioncontainer.morepadding{ @@ -9561,7 +9560,7 @@ min-width : 17px; max-width : 150px; - -webkit-box-flex : 1; + flex : 1; position : relative; width : 0; line-height : 1.2em; @@ -10811,6 +10810,8 @@ -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; + width: 100%; + min-width: 0; } .docktab .btncontainer{ @@ -10822,7 +10823,7 @@ width : auto; clip: rect(0px 3000px 30px 0px); - display : -webkit-box; + display : flex; } .dockcol .docktab .btncontainer{ @@ -10845,7 +10846,7 @@ min-width : 17px; max-width : 100px; - -webkit-box-flex : 1; + flex : 1; width : 0; padding : 3px 2px 4px; @@ -12542,13 +12543,10 @@ .img div { width : 100%; height : 100%; - display: -webkit-box; - -webkit-box-orient: horizontal; - box-orient: horizontal; - -webkit-box-pack: center; - box-pack: center; - -webkit-box-align: center; - box-align: center; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; } .img IMG { diff --git a/plugins-client/ext.preview/preview.js b/plugins-client/ext.preview/preview.js index 62071127a..04027b4e3 100644 --- a/plugins-client/ext.preview/preview.js +++ b/plugins-client/ext.preview/preview.js @@ -167,9 +167,17 @@ module.exports = ext.register($name, { if (!button || !button.cache) return; var pNode = button.cache.$dockpage.$pHtmlNode; - if (pNode.children.length === 4) { - pNode.removeChild(pNode.children[2]); - pNode.children[2].style.top = 0; + // Find and hide the caption element by class instead of + // removing by index, which could destroy the iframe. + for (var i = 0; i < pNode.children.length; i++) { + var child = pNode.children[i]; + if (child.className && child.className.indexOf('docktab_page_caption') !== -1) { + child.style.display = 'none'; + // Expand the content area below to fill the space + var next = pNode.children[i + 1]; + if (next) next.style.top = '0'; + break; + } } }, @@ -182,10 +190,10 @@ module.exports = ext.register($name, { })[0]; if (page) this.live.value = page.$doc.getValue(); - var iframe = this.getIframe().$ext; - if (!iframe || !iframe.contentWindow) + var frm = this.getIframe(); + if (!frm || !frm.$browser || !frm.$browser.contentWindow) return; - var html = iframe.contentWindow.document.getElementsByTagName("html")[0]; + var html = frm.$browser.contentWindow.document.getElementsByTagName("html")[0]; html.innerHTML = this.live.value; }, @@ -195,8 +203,8 @@ module.exports = ext.register($name, { dock.expandBar(bar); dock.showSection(this.$name, this.$button); this.hidePageHeader(); - var frmPreview = this.getIframe(); - if (frmPreview.$ext.src !== url) + var frm = this.getIframe(); + if (frm && frm.$browser && frm.$browser.src !== url) this.refresh(url); this.live = live; }, @@ -207,9 +215,10 @@ module.exports = ext.register($name, { }, refresh: function (url) { - var frmPreview = this.getIframe(); + var frm = this.getIframe(); + if (!frm) return; url = url || txtPreview.getValue(); - frmPreview.$ext.src = url; + frm.$browser.src = url; txtPreview.setValue(url); settings.save(); }, @@ -222,10 +231,45 @@ module.exports = ext.register($name, { init: function() { ppc.importCssString(this.css || ""); + + // Size the browser iframe to fill the page below the toolbar. + // PPC page elements don't support flexbox so we calculate + // the height dynamically based on the docktab container. + var fixSize = function() { + if (typeof frmPreview === 'undefined' || !frmPreview.$ext || + typeof pgPreview === 'undefined' || !pgPreview.$ext) { + setTimeout(fixSize, 200); + return; + } + + var iframe = frmPreview.$ext; + iframe.style.border = 'none'; + iframe.style.width = '100%'; + + var resize = function() { + // Find the docktab ancestor to get the available height + var el = pgPreview.$ext; + while (el && !(el.className || '').match(/docktab/)) { + el = el.parentElement; + } + if (!el) return; + var availH = el.getBoundingClientRect().height; + // 36px for the toolbar bar + iframe.style.height = Math.max(0, availH - 36 - 28) + 'px'; + }; + + resize(); + // Re-size when window resizes + window.addEventListener('resize', resize); + // Also periodically check in case dock panel is resized + setInterval(resize, 500); + }; + fixSize(); }, getIframe: function() { - return pgPreview.selectSingleNode("iframe"); + // frmPreview is the PPC browser element defined in preview.xml + return typeof frmPreview !== 'undefined' ? frmPreview : null; }, enable : function() { diff --git a/plugins-client/ext.preview/preview.xml b/plugins-client/ext.preview/preview.xml index fa9b76831..3ec9edc6f 100755 --- a/plugins-client/ext.preview/preview.xml +++ b/plugins-client/ext.preview/preview.xml @@ -1,7 +1,7 @@ - + -