Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
Gooong committed Aug 4, 2018
1 parent 1200d67 commit 3e1bf36
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions web/pgadmin/tools/sqleditor/static/js/sqleditor.js
Expand Up @@ -821,16 +821,18 @@ define('tools.querytool', [
headerButtonsPlugin.onCommand.subscribe(function (e, args) {
let columns = args.grid.getColumns();
let columnIndex = columns.indexOf(args.column);

if (self.handler.has_more_rows){
let command = args.command;
if(command === 'view-all-geometries'){
if (self.handler.has_more_rows){
// fetch all the data before rendering geometries in the column.
self.fetch_next_all(function () {
self.fetch_next_all(function () {
let items = args.grid.getData().getItems();
GeometryViewer.render_geometry(items, columns, columnIndex);
});
}else{
let items = args.grid.getData().getItems();
GeometryViewer.render_geometry(items, columns, columnIndex);
});
}else{
let items = args.grid.getData().getItems();
GeometryViewer.render_geometry(items, columns, columnIndex);
}
}
});
grid.registerPlugin(headerButtonsPlugin);
Expand Down

0 comments on commit 3e1bf36

Please sign in to comment.