From 3743c6e86ed74b8ae6f4776f27e1555c4ee64e89 Mon Sep 17 00:00:00 2001 From: Murtuza Zabuawala Date: Mon, 12 Jun 2017 13:25:52 +0100 Subject: [PATCH] Refresh the SQL editor view on resize to ensure the contents are re-rendered for the new viewport. Fixes #2078 --- .../sqleditor/templates/sqleditor/js/sqleditor.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js index da24f7714..ea8fedbf1 100644 --- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js @@ -176,6 +176,16 @@ define([ scrollbarStyle: 'simple' }); + // Refresh Code mirror on SQL panel resize to + // display its value properly + sql_panel_obj.on(wcDocker.EVENT.RESIZE_ENDED, function() { + setTimeout(function() { + if(self && self.query_tool_obj) { + self.query_tool_obj.refresh(); + } + }, 200); + }); + // Create panels for 'Data Output', 'Explain', 'Messages' and 'History' var data_output = new pgAdmin.Browser.Panel({ name: 'data_output',