Improve consistency of dialogue controls offered. Fixes #1364

This commit is contained in:
Murtuza Zabuawala
2017-01-08 16:05:34 +05:30
committed by Dave Page
parent 8d71e888b4
commit bdf9761472
5 changed files with 46 additions and 5 deletions

View File

@@ -419,7 +419,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
options: {
padding : !1,
overflow: !1,
model: 0,
modal:false,
resizable: true,
maximizable: true,
pinnable: false,

View File

@@ -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;

View File

@@ -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;

View File

@@ -365,7 +365,8 @@ define(
overflow: !1,
title: '{{ _('Preferences')|safe }}',
closableByDimmer: false,
modal:false
modal:false,
pinnable: false
}
};
},

View File

@@ -429,7 +429,7 @@ define([
},
prepare:function() {
var that = this;
$container.empty().append("<div class='grant_wizard_container'></div>");
// Define el for wizard view
@@ -1062,7 +1062,9 @@ define([
curr_page: 0,
show_left_panel: false,
show_header_cancel_btn: true,
show_header_maximize_btn: true,
disable_finish: true,
dialog_api: that,
wizard_help: "{{ url_for('help.static', filename='grant_wizard.html') }}"
},