public inbox for [email protected]  
help / color / mirror / Atom feed
From: Surinder Kumar <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch]: Render data grid only if Dashboard Panel is active
Date: Wed, 13 Jul 2016 12:17:26 +0530
Message-ID: <CAM5-9D9qt9YZQa3Enpt9qXYk+kufqXTgENBB_DjAcvj2Y1Q50g@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi

In Dashboard, the ajax calls to *render data grid* should only made, if
dashboard panel is active.
Currently it make ajax calls even if other panels like properties, sql are
active.

Please find attached patch and review.

Thanks,
Surinder Kumar


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] dashboard_render_if_panel_is_opened.patch (665B, 3-dashboard_render_if_panel_is_opened.patch)
  download | inline diff:
diff --git a/web/pgadmin/dashboard/templates/dashboard/js/dashboard.js b/web/pgadmin/dashboard/templates/dashboard/js/dashboard.js
index 9a470d9..a67ceee 100644
--- a/web/pgadmin/dashboard/templates/dashboard/js/dashboard.js
+++ b/web/pgadmin/dashboard/templates/dashboard/js/dashboard.js
@@ -309,6 +309,11 @@ function(r, $, pgAdmin, _, Backbone) {
               return null;
             }

+            var dashboardPanel = pgBrowser.panels['dashboard'].panel;
+            if (dashboardPanel && !dashboardPanel.isVisible()) {
+              return;
+            }
+
             data.fetch({
                 reset: true,
                 success: function() {


view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin4][Patch]: Render data grid only if Dashboard Panel is active
  In-Reply-To: <CAM5-9D9qt9YZQa3Enpt9qXYk+kufqXTgENBB_DjAcvj2Y1Q50g@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox