public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin4][Patch]: RM#1422 - "Move to last page" warning shown unnecessarily
2+ messages / 2 participants
[nested] [flat]

* [pgAdmin4][Patch]: RM#1422 - "Move to last page" warning shown unnecessarily
@ 2016-07-05 10:28  Surinder Kumar <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Surinder Kumar @ 2016-07-05 10:28 UTC (permalink / raw)
  To: pgadmin-hackers

Hi

Please find attached patch with fix.

> If last page attribute of collection is null, that means it is first page.
> This check is applied for add new row and paste row as well.


Please 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] RM#1422.patch (1.5K, 3-RM%231422.patch)
  download | inline diff:
diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
index 5b08623..8e0c24b 100644
--- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
@@ -1795,7 +1795,9 @@ define(
           }
           else {
             // If current page is not the last page then confirm from the user
-            if (self.collection.state.currentPage != self.collection.state.lastPage) {
+            if (self.collection.state.lastPage != null &&
+                self.collection.state.currentPage != self.collection.state.lastPage
+              ) {
               alertify.confirm('{{ _('Add New Row') }}',
                 '{{ _('The result set display will move to the last page. Do you wish to continue?') }}',
                 function() {
@@ -2296,7 +2298,9 @@ define(
           }
           else {
             // If current page is not the last page then confirm from the user
-            if (self.collection.state.currentPage != self.collection.state.lastPage) {
+            if (self.collection.state.lastPage != null &&
+                self.collection.state.currentPage != self.collection.state.lastPage
+              ) {
               alertify.confirm('{{ _('Paste Row') }}',
                 '{{ _('The result set display will move to the last page. Do you wish to continue?') }}',
                 function() {


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [pgAdmin4][Patch]: RM#1422 - "Move to last page" warning shown unnecessarily
@ 2016-07-05 11:21  Dave Page <[email protected]>
  parent: Surinder Kumar <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Page @ 2016-07-05 11:21 UTC (permalink / raw)
  To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers

Thanks, applied.

On Tue, Jul 5, 2016 at 11:28 AM, Surinder Kumar
<[email protected]> wrote:
> Hi
>
> Please find attached patch with fix.
>>
>> If last page attribute of collection is null, that means it is first page.
>> This check is applied for add new row and paste row as well.
>
>
> Please 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
>



-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2016-07-05 11:21 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-07-05 10:28 [pgAdmin4][Patch]: RM#1422 - "Move to last page" warning shown unnecessarily Surinder Kumar <[email protected]>
2016-07-05 11:21 ` Dave Page <[email protected]>

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