Merge pull request #3444 from FinnStutzenstein/ScrollTopOnPageChange
Go to top on a page change
This commit is contained in:
commit
73407133bd
@ -164,6 +164,7 @@ angular.module('OpenSlidesApp.agenda.site', [
|
|||||||
$scope.limitBegin = 0;
|
$scope.limitBegin = 0;
|
||||||
$scope.pageChanged = function() {
|
$scope.pageChanged = function() {
|
||||||
$scope.limitBegin = ($scope.currentPage - 1) * $scope.itemsPerPage;
|
$scope.limitBegin = ($scope.currentPage - 1) * $scope.itemsPerPage;
|
||||||
|
$scope.gotoTop();
|
||||||
};
|
};
|
||||||
|
|
||||||
// parse duration for inline editing
|
// parse duration for inline editing
|
||||||
|
@ -128,7 +128,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="spacer-top-lg italic">
|
<div class="spacer-top-lg italic row">
|
||||||
|
<div class="col-md-6">
|
||||||
<span os-perms="agenda.can_see_hidden_items">{{ itemsFiltered.length }} /</span>
|
<span os-perms="agenda.can_see_hidden_items">{{ itemsFiltered.length }} /</span>
|
||||||
{{ items.length }} {{ "items" | translate }}<span ng-if="(items|filter:{selected:true}).length > 0">,
|
{{ items.length }} {{ "items" | translate }}<span ng-if="(items|filter:{selected:true}).length > 0">,
|
||||||
{{(items|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
{{(items|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
||||||
@ -140,6 +141,13 @@
|
|||||||
(<translate>Estimated end:</translate> {{ calculateEndTime() }})
|
(<translate>Estimated end:</translate> {{ calculateEndTime() }})
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6" ng-show="itemsFiltered.length > itemsPerPage">
|
||||||
|
<span class="pull-right">
|
||||||
|
<translate>Page</translate> {{ currentPage }} / {{ Math.ceil(itemsFiltered.length/itemsPerPage) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="agenda-table" class="os-table container-fluid">
|
<div id="agenda-table" class="os-table container-fluid">
|
||||||
|
@ -351,6 +351,7 @@ angular.module('OpenSlidesApp.assignments.site', [
|
|||||||
$scope.limitBegin = 0;
|
$scope.limitBegin = 0;
|
||||||
$scope.pageChanged = function() {
|
$scope.pageChanged = function() {
|
||||||
$scope.limitBegin = ($scope.currentPage - 1) * $scope.itemsPerPage;
|
$scope.limitBegin = ($scope.currentPage - 1) * $scope.itemsPerPage;
|
||||||
|
$scope.gotoTop();
|
||||||
};
|
};
|
||||||
|
|
||||||
// update phase
|
// update phase
|
||||||
|
@ -71,11 +71,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="spacer-top-lg italic">
|
<div class="spacer-top-lg italic row">
|
||||||
|
<div class="col-md-6">
|
||||||
{{ assignmentsFiltered.length }} /
|
{{ assignmentsFiltered.length }} /
|
||||||
{{ assignments.length }} {{ "elections" | translate }}<span ng-if="(assignments|filter:{selected:true}).length > 0">,
|
{{ assignments.length }} {{ "elections" | translate }}<span ng-if="(assignments|filter:{selected:true}).length > 0">,
|
||||||
{{(assignments|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
{{(assignments|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-6" ng-show="assignmentsFiltered.length > itemsPerPage">
|
||||||
|
<span class="pull-right">
|
||||||
|
<translate>Page</translate> {{ currentPage }} / {{ Math.ceil(assignmentsFiltered.length/itemsPerPage) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="os-table container-fluid">
|
<div class="os-table container-fluid">
|
||||||
<div class="row header-row">
|
<div class="row header-row">
|
||||||
|
@ -526,6 +526,14 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
// Put the Math object into every scope.
|
||||||
|
.run([
|
||||||
|
'$rootScope',
|
||||||
|
function ($rootScope) {
|
||||||
|
$rootScope.Math = window.Math;
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
// Template hooks
|
// Template hooks
|
||||||
// 2 possible uses:
|
// 2 possible uses:
|
||||||
// - { Id: 'myHookId', template: '<button>click me</button>' }
|
// - { Id: 'myHookId', template: '<button>click me</button>' }
|
||||||
|
@ -1008,7 +1008,14 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
$scope.show = ($window.pageYOffset >= 150);
|
$scope.show = ($window.pageYOffset >= 150);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$scope.gotoTop = function () {
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
.run([
|
||||||
|
'$rootScope',
|
||||||
|
'$window',
|
||||||
|
function ($rootScope, $window) {
|
||||||
|
$rootScope.gotoTop = function () {
|
||||||
$window.scrollTo(0, 0);
|
$window.scrollTo(0, 0);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1052,6 +1052,7 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
$scope.limitBegin = 0;
|
$scope.limitBegin = 0;
|
||||||
$scope.pageChanged = function() {
|
$scope.pageChanged = function() {
|
||||||
$scope.limitBegin = ($scope.currentPage - 1) * $scope.itemsPerPage;
|
$scope.limitBegin = ($scope.currentPage - 1) * $scope.itemsPerPage;
|
||||||
|
$scope.gotoTop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -120,11 +120,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="spacer-top-lg italic">
|
<div class="spacer-top-lg italic row">
|
||||||
|
<div class="col-md-6">
|
||||||
{{ motionsFiltered.length }} /
|
{{ motionsFiltered.length }} /
|
||||||
{{ motions.length }} {{ "motions" | translate }}<span ng-if="(motions|filter:{selected:true}).length > 0">,
|
{{ motions.length }} {{ "motions" | translate }}<span ng-if="(motions|filter:{selected:true}).length > 0">,
|
||||||
{{(motions|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
{{(motions|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-6" ng-show="motionsFiltered.length > itemsPerPage">
|
||||||
|
<span class="pull-right">
|
||||||
|
<translate>Page</translate> {{ currentPage }} / {{ Math.ceil(motionsFiltered.length/itemsPerPage) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="os-table container-fluid">
|
<div class="os-table container-fluid">
|
||||||
<div class="row header-row">
|
<div class="row header-row">
|
||||||
|
@ -623,6 +623,7 @@ angular.module('OpenSlidesApp.users.site', [
|
|||||||
$scope.limitBegin = 0;
|
$scope.limitBegin = 0;
|
||||||
$scope.pageChanged = function() {
|
$scope.pageChanged = function() {
|
||||||
$scope.limitBegin = ($scope.currentPage - 1) * $scope.itemsPerPage;
|
$scope.limitBegin = ($scope.currentPage - 1) * $scope.itemsPerPage;
|
||||||
|
$scope.gotoTop();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Toggle group from user
|
// Toggle group from user
|
||||||
|
@ -126,11 +126,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="spacer-top-lg italic">
|
<div class="spacer-top-lg italic row">
|
||||||
|
<div class="col-md-6">
|
||||||
{{ usersFiltered.length }} /
|
{{ usersFiltered.length }} /
|
||||||
{{ users.length }} {{ "participants" | translate }}<span ng-if="(users|filter:{selected:true}).length > 0">,
|
{{ users.length }} {{ "participants" | translate }}<span ng-if="(users|filter:{selected:true}).length > 0">,
|
||||||
{{(users|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
{{(users|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-6" ng-show="usersFiltered.length > itemsPerPage">
|
||||||
|
<span class="pull-right">
|
||||||
|
<translate>Page</translate> {{ currentPage }} / {{ Math.ceil(usersFiltered.length/itemsPerPage) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- filter users (for user with 'can_see_extra_data' permission) - consider present filter -->
|
<!-- filter users (for user with 'can_see_extra_data' permission) - consider present filter -->
|
||||||
<div os-perms="users.can_see_extra_data">
|
<div os-perms="users.can_see_extra_data">
|
||||||
|
Loading…
Reference in New Issue
Block a user