mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added support to rename query tool and debugger tabs. Fixes #4230
Fixed an issue where non-closeable tabs are getting closed. Fixes #5923
This commit is contained in:
committed by
Akshay Joshi
parent
c2ad97d0ab
commit
c86a3d64fc
@@ -441,6 +441,21 @@ define([
|
||||
method: 'DELETE',
|
||||
});
|
||||
});
|
||||
|
||||
// Panel Rename event
|
||||
panel.on(wcDocker.EVENT.RENAME, function(panel_data) {
|
||||
Alertify.prompt('', panel_data.$titleText[0].textContent,
|
||||
// We will execute this function when user clicks on the OK button
|
||||
function(evt, value) {
|
||||
if(value) {
|
||||
debuggerUtils.setDebuggerTitle(panel, self.preferences, treeInfo.function.label, treeInfo.schema.label, treeInfo.database.label, value);
|
||||
}
|
||||
},
|
||||
// We will execute this function when user clicks on the Cancel
|
||||
// button. Do nothing just close it.
|
||||
function(evt) { evt.cancel = false; }
|
||||
).set({'title': gettext('Rename Panel')});
|
||||
});
|
||||
}
|
||||
})
|
||||
.fail(function(xhr) {
|
||||
|
||||
@@ -787,6 +787,21 @@ define([
|
||||
method: 'DELETE',
|
||||
});
|
||||
});
|
||||
|
||||
// Panel Rename event
|
||||
panel.on(wcDocker.EVENT.RENAME, function(panel_data) {
|
||||
Alertify.prompt('', panel_data.$titleText[0].textContent,
|
||||
// We will execute this function when user clicks on the OK button
|
||||
function(evt, value) {
|
||||
if(value) {
|
||||
debuggerUtils.setDebuggerTitle(panel, self.preferences, treeInfo.function.label, treeInfo.schema.label, treeInfo.database.label, value);
|
||||
}
|
||||
},
|
||||
// We will execute this function when user clicks on the Cancel
|
||||
// button. Do nothing just close it.
|
||||
function(evt) { evt.cancel = false; }
|
||||
).set({'title': gettext('Rename Panel')});
|
||||
});
|
||||
}
|
||||
var _url;
|
||||
|
||||
|
||||
@@ -42,8 +42,14 @@ function getProcedureId(treeInfoObject) {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
function setDebuggerTitle(panel, preferences, function_name, schema_name, database_name) {
|
||||
var debugger_title_placeholder = preferences['debugger_tab_title_placeholder'];
|
||||
function setDebuggerTitle(panel, preferences, function_name, schema_name, database_name, custom_title) {
|
||||
var debugger_title_placeholder = '';
|
||||
if(custom_title) {
|
||||
debugger_title_placeholder = custom_title;
|
||||
} else {
|
||||
debugger_title_placeholder = preferences['debugger_tab_title_placeholder'];
|
||||
}
|
||||
|
||||
var placeholders = debugger_title_placeholder.split('%');
|
||||
|
||||
var title = '';
|
||||
|
||||
Reference in New Issue
Block a user