mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Improve consistency of dialogue controls offered. Fixes #1364
This commit is contained in:
committed by
Dave Page
parent
8d71e888b4
commit
bdf9761472
@@ -117,6 +117,21 @@
|
||||
margin-top: -1px;
|
||||
}
|
||||
|
||||
|
||||
div.wizard-header.wizard-badge > div > div.col-sm-2 > button.ajs-maximize.wizard-maximize-event.pull-right {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAZklEQVQ4jcWTuw2AMAxEn5jBs7B/e0gpmAiKEGRS5QDBSS7v+Q8fSsCWQgDTA+DsGgJYuypumTNkWCWZg9q/HIAOSDim/xTUcu0exXXaxQG0teRVWQPLx2Gbe8B55yNqv7C4GV/TDq//J11odoZgAAAAAElFTkSuQmCC) no-repeat center center;
|
||||
padding: 10px;
|
||||
margin-top: -1px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
div.wizard-header.wizard-badge > div > div.col-sm-2 > button.ajs-maximized.ajs-maximize.wizard-maximize-event.pull-right {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA8klEQVQ4jZ3QMUpDQRCH8V+ewULQE4iERTyCrQiDCpbaCKKljbV4A89gqVgGrCMDWlpaWwVPoFYiIjYv8hBJXjLN7s7u9+3wZ4aKiOWI2IJOi8dHuM7MXxj3WMHe3CRBKeUGvVJKllJG8CrmoNty6jMsYKeGoY/jtgI4bez7OMjMr2oKwaieRzDMIljDRUSgXQZPeG2cv7GOffQ7ETGPcyw2HozWQWY+jLN3M/MzIu4wwNKf+zeMFVSQmY/YbfzeuiqIiAonZgi1quErHNa9F7xPM8FlAx5iA9ttJRVu8VHDm5k5rDNpLRERWxHR+6c/MZMfLIJDwzY66IkAAAAASUVORK5CYII=) no-repeat center center;
|
||||
padding: 10px;
|
||||
margin-top: -1px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
/* Wizard Status bar CSS */
|
||||
.pgadmin-wizard .wizard-description {
|
||||
padding: 1.0em 0.1em;
|
||||
|
||||
@@ -43,6 +43,8 @@ function(_, Backbone, pgAdmin, pgBrowser) {
|
||||
disable_finish: false,
|
||||
disable_cancel: false,
|
||||
show_header_cancel_btn: false, /* show cancel button at wizard header */
|
||||
show_header_maximize_btn: false, /* show maximize button at wizard header */
|
||||
dialog_api: null,
|
||||
height: 400,
|
||||
width: 650,
|
||||
show_left_panel: true,
|
||||
@@ -53,13 +55,16 @@ function(_, Backbone, pgAdmin, pgBrowser) {
|
||||
+ " width: <%= this.options.width %>px'>"
|
||||
+ " <div class='wizard-header wizard-badge'>"
|
||||
+ " <div class='row'>"
|
||||
+ " <div class='col-sm-9'>"
|
||||
+ " <div class='col-sm-10'>"
|
||||
+ " <h3><span id='main-title'><%= this.options.title %></span> -"
|
||||
+ " <span id='step-title'><%= page_title %></span></h3>"
|
||||
+ " </div>"
|
||||
+ " <% if (this.options.show_header_cancel_btn) { %>"
|
||||
+ " <div class='col-sm-3'>"
|
||||
+ " <div class='col-sm-2'>"
|
||||
+ " <button class='ajs-close wizard-cancel-event pull-right'></button>"
|
||||
+ " <% if (this.options.show_header_maximize_btn) { %>"
|
||||
+ " <button class='ajs-maximize wizard-maximize-event pull-right'></button>"
|
||||
+ " <% } %>"
|
||||
+ " </div>"
|
||||
+ " <% } %>"
|
||||
+ " </div>"
|
||||
@@ -112,6 +117,7 @@ function(_, Backbone, pgAdmin, pgBrowser) {
|
||||
"click button.wizard-back" : "prevPage",
|
||||
"click button.wizard-cancel" : "onCancel",
|
||||
"click button.wizard-cancel-event" : "onCancel",
|
||||
"click button.wizard-maximize-event" : "onMaximize",
|
||||
"click button.wizard-finish" : "finishWizard",
|
||||
"click button.wizard-help" : "onDialogHelp",
|
||||
},
|
||||
@@ -233,6 +239,23 @@ function(_, Backbone, pgAdmin, pgBrowser) {
|
||||
this.$el.remove();
|
||||
return true;
|
||||
},
|
||||
onMaximize: function() {
|
||||
var dialog_api = this.options.dialog_api,
|
||||
old_classes, _el = this.$el.find('.wizard-maximize-event');
|
||||
|
||||
// If no dialog api found then return
|
||||
if(!dialog_api) return;
|
||||
|
||||
if(dialog_api.isMaximized()) {
|
||||
// toggle the icon
|
||||
_el.removeClass('ajs-maximized');
|
||||
dialog_api.restore();
|
||||
} else {
|
||||
// toggle the icon
|
||||
_el.addClass('ajs-maximized ' + _el.attr('class'));
|
||||
dialog_api.maximize();
|
||||
}
|
||||
},
|
||||
evalASFunc: function(func, ctx) {
|
||||
var self = this;
|
||||
ctx = ctx || self.currPage;
|
||||
|
||||
Reference in New Issue
Block a user