diff --git a/views_load_more.module b/views_load_more.module index bfe4caa..ff33b6f 100644 --- a/views_load_more.module +++ b/views_load_more.module @@ -30,7 +30,11 @@ function views_load_more_views_ajax_data_alter(&$commands, $view) { if ($view->query->pager->current_page == 0) { return; } - foreach ($commands as $key => $command) { + foreach ($commands as $key => $command) { + // remove "viewsScrollTop" command, as this behavior is unnecessary. + if ($command['command'] == 'viewsScrollTop') { + unset($commands[$key]); + } // the replace should the only one, but just incase, we'll make sure. if ($command['command'] == 'insert' && $command['selector'] == '.view-dom-id-' . $view->dom_id) { $commands[$key]['command'] = 'viewsLoadMoreAppend';