mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-11 16:06:02 -06:00
(tabbed) UI. Also, fixed few bugs pointed by Dave: * Open the URL in separate browser tab/window. * Fixed few CSS changes for look and feel for the dialog view * Some of the panels were not listed in the context menu for the wcDocker.
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
define(
|
|
['underscore', 'pgadmin', 'wcdocker'],
|
|
function(_, pgAdmin) {
|
|
|
|
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
pgAdmin.Browser.Frame = function(options) {
|
|
var defaults = [
|
|
'name', 'title', 'width', 'height', 'showTitle', 'isCloseable',
|
|
'isPrivate', 'url'];
|
|
_.extend(this, _.pick(options, defaults));
|
|
}
|
|
|
|
_.extend(pgAdmin.Browser.Frame.prototype, {
|
|
name:'',
|
|
title: '',
|
|
width: 300,
|
|
height: 600,
|
|
showTitle: true,
|
|
isClosable: true,
|
|
isPrivate: false,
|
|
url: 'about:blank',
|
|
panel: null,
|
|
frame: null,
|
|
load: function(docker) {
|
|
var that = this;
|
|
if (!that.panel) {
|
|
docker.registerPanelType(this.name, {
|
|
title: that.title,
|
|
isPrivate: that.isPrivate,
|
|
onCreate: function(myPanel) {
|
|
myPanel.initSize(that.width, that.height);
|
|
if (myPanel.showTitle == false)
|
|
myPanle.title(false);
|
|
myPanel.closeable(!!that.isCloseable);
|
|
|
|
var $frameArea = $('<div style="width:100%;height:100%;position:relative;display:table">');
|
|
myPanel.layout().addItem($frameArea);
|
|
that.panel = myPanel;
|
|
that.frame = new wcIFrame($frameArea, myPanel);
|
|
|
|
setTimeout(function() { that.frame.openURL(that.url); }, 500);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
return pgAdmin.Browser.Frame;
|
|
});
|