Preferences and user management help button fixes. Fixes #1318

This commit is contained in:
Harshal Dhumal
2016-06-14 12:33:03 +01:00
committed by Dave Page
parent fe1c86cbbe
commit 93706ee40b
2 changed files with 20 additions and 11 deletions

View File

@@ -1,8 +1,8 @@
define( define(
['jquery', 'alertify', 'pgadmin', 'underscore', 'backform', 'pgadmin.backform'], ['jquery', 'alertify', 'pgadmin', 'underscore', 'backform', 'pgadmin.browser', 'pgadmin.backform'],
// This defines the Preference/Options Dialog for pgAdmin IV. // This defines the Preference/Options Dialog for pgAdmin IV.
function($, alertify, pgAdmin, _, Backform) { function($, alertify, pgAdmin, _, Backform, pgBrowser) {
pgAdmin = pgAdmin || window.pgAdmin || {}; pgAdmin = pgAdmin || window.pgAdmin || {};
/* /*
@@ -351,12 +351,13 @@ define(
}, },
setup:function(){ setup:function(){
return { return {
buttons:[ buttons:[{
{ text: '', key: 27, className: 'btn btn-default pull-left fa fa-lg fa-question',
attrs:{name:'dialog_help', type:'button', label: '{{ _('Preferences') }}',
url: '{{ url_for('help.static', filename='preferences_dialog.html') }}'}
},{
text: "{{ _('OK') }}", key: 13, className: "btn btn-primary fa fa-lg fa-save pg-alertify-button" text: "{{ _('OK') }}", key: 13, className: "btn btn-primary fa fa-lg fa-save pg-alertify-button"
},{
},
{
text: "{{ _('Cancel') }}", className: "btn btn-danger fa fa-lg fa-times pg-alertify-button" text: "{{ _('Cancel') }}", className: "btn btn-danger fa fa-lg fa-times pg-alertify-button"
} }
], ],
@@ -365,12 +366,20 @@ define(
padding: !1, padding: !1,
overflow: !1, overflow: !1,
title: '{{ _('Preferences')|safe }}', title: '{{ _('Preferences')|safe }}',
closableByDimmer: false closableByDimmer: false,
modal:false
} }
}; };
}, },
callback: function(closeEvent){ callback: function(e){
if (closeEvent.button.text == "{{ _('OK') }}"){ if (e.button.element.name == "dialog_help") {
e.cancel = true;
pgBrowser.showHelp(e.button.element.name, e.button.element.getAttribute('url'),
null, null, e.button.element.getAttribute('label'));
return;
}
if (e.button.text == "{{ _('OK') }}"){
preferences.updateAll(); preferences.updateAll();
} }
}, },

View File

@@ -390,7 +390,7 @@ define([
//disable both padding and overflow control. //disable both padding and overflow control.
padding : !1, padding : !1,
overflow: !1, overflow: !1,
model: 0, modal: false,
resizable: true, resizable: true,
maximizable: true, maximizable: true,
pinnable: false, pinnable: false,