fix #2777 : scroll to top feature implemented (#2873)

* scroll to top feature

* small fix

* unwanted commits removed

* unwanted commits removed2

* unwanted commits removed3
This commit is contained in:
Anwesh Nayak 2021-03-06 00:54:31 +05:30 committed by GitHub
parent fb62fb2c49
commit 89974697aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 65 additions and 8 deletions

View File

@ -1,6 +1,6 @@
(function (module) {
mifosX.controllers = _.extend(module, {
AccCoaController: function (scope,$rootScope, translate, resourceFactory, location) {
AccCoaController: function (scope,$rootScope, translate, resourceFactory, location, anchorScroll) {
$rootScope.tempNodeID = -100; // variable used to store nodeID (from directive), so it(nodeID) is available for detail-table
@ -11,6 +11,12 @@
location.path('/viewglaccount/' + id);
};
scope.scrollto = function (link){
location.hash(link);
anchorScroll();
};
if (!scope.searchCriteria.acoa) {
scope.searchCriteria.acoa = null;
scope.saveSC();
@ -110,7 +116,7 @@
}
});
mifosX.ng.application.controller('AccCoaController', ['$scope','$rootScope', '$translate', 'ResourceFactory', '$location', mifosX.controllers.AccCoaController]).run(function ($log) {
mifosX.ng.application.controller('AccCoaController', ['$scope','$rootScope', '$translate', 'ResourceFactory', '$location','$anchorScroll', mifosX.controllers.AccCoaController]).run(function ($log) {
$log.info("AccCoaController initialized");
});
}(mifosX.controllers || {}));

View File

@ -1,6 +1,6 @@
(function (module) {
mifosX.controllers = _.extend(module, {
AccountingClosureController: function (scope, resourceFactory, location, translate, routeParams, dateFilter) {
AccountingClosureController: function (scope, resourceFactory, location, anchorScroll, translate, routeParams, dateFilter) {
scope.first = {};
scope.formData = {};
scope.first.date = new Date();
@ -22,6 +22,12 @@
scope.routeTo = function (id) {
location.path('/view_close_accounting/' + id);
};
scope.scrollto = function (link){
location.hash(link);
anchorScroll();
};
scope.submit = function () {
var reqDate = dateFilter(scope.first.date, scope.df);
@ -49,7 +55,7 @@
}
}
});
mifosX.ng.application.controller('AccountingClosureController', ['$scope', 'ResourceFactory', '$location', '$translate', '$routeParams', 'dateFilter', mifosX.controllers.AccountingClosureController]).run(function ($log) {
mifosX.ng.application.controller('AccountingClosureController', ['$scope', 'ResourceFactory', '$location', '$translate', '$routeParams', 'dateFilter','$anchorScroll', mifosX.controllers.AccountingClosureController]).run(function ($log) {
$log.info("AccountingClosureController initialized");
});
}(mifosX.controllers || {}));

View File

@ -1,16 +1,23 @@
(function (module) {
mifosX.controllers = _.extend(module, {
AccountingRuleController: function (scope, resourceFactory, location) {
AccountingRuleController: function (scope, resourceFactory, location, anchorScroll) {
scope.routeTo = function (id) {
location.path('/viewaccrule/' + id);
};
scope.scrollto = function (link){
location.hash(link);
anchorScroll();
};
resourceFactory.accountingRulesResource.get(function (data) {
scope.rules = data;
});
}
});
mifosX.ng.application.controller('AccountingRuleController', ['$scope', 'ResourceFactory', '$location', mifosX.controllers.AccountingRuleController]).run(function ($log) {
mifosX.ng.application.controller('AccountingRuleController', ['$scope', 'ResourceFactory', '$location','$anchorScroll', mifosX.controllers.AccountingRuleController]).run(function ($log) {
$log.info("AccountingRuleController initialized");
});
}(mifosX.controllers || {}));

View File

@ -1,6 +1,6 @@
(function (module) {
mifosX.controllers = _.extend(module, {
ViewReportsController: function (scope, routeParams, resourceFactory, location, route) {
ViewReportsController: function (scope, routeParams, resourceFactory, location, anchorScroll, route) {
scope.reports = [];
scope.type = routeParams.type;
//to display type of report on breadcrumb
@ -11,6 +11,12 @@
location.path('/run_report/' + report.report_name).search({reportId: report.report_id, type: report.report_type});
};
scope.scrollto = function (link){
location.hash(link);
anchorScroll();
};
if (!scope.searchCriteria.reports) {
scope.searchCriteria.reports = null;
scope.saveSC();
@ -82,7 +88,7 @@
};
}
});
mifosX.ng.application.controller('ViewReportsController', ['$scope', '$routeParams', 'ResourceFactory', '$location', '$route', mifosX.controllers.ViewReportsController]).run(function ($log) {
mifosX.ng.application.controller('ViewReportsController', ['$scope', '$routeParams', 'ResourceFactory', '$location', '$route', '$anchorScroll' ,mifosX.controllers.ViewReportsController]).run(function ($log) {
$log.info("ViewReportsController initialized");
});
}(mifosX.controllers || {}));

View File

@ -1,3 +1,4 @@
<div id="viewlptop"></div>
<div class="content-container" ng-controller="AccCoaController">
<ul class="breadcrumb">
<li><a href="#/accounting">{{'label.anchor.accounting' | translate}}</a></li>
@ -41,6 +42,13 @@
<td class="pointer" data-ng-click="routeTo(coadata.id)">{{coadata.usage.value}}</td>
</tr>
</tbody>
<tr>
<td colspan="5">
</td>
<td class="pull-right">
<a ng-click="scrollto('viewlptop')"><i class="fa fa-upload"></i>{{'label.button.top' | translate}}</a>
</td>
</tr>
</table>
<dir-pagination-controls boundary-links="true" template-url="bower_components/angular-utils-pagination/dirPagination.tpl.html"></dir-pagination-controls>
</div>

View File

@ -1,3 +1,4 @@
<div id="viewlptop"></div>
<div class="content-container">
<ul class="breadcrumb">
<li><a href="#/accounting">{{'label.anchor.accounting' | translate}}</a></li>
@ -31,5 +32,12 @@
<td class="pointer width14" data-ng-click="routeTo(rule.id)">{{rule.creditAccounts[0].name}}</td>
</tr>
</tbody>
<tr>
<td colspan="5">
</td>
<td class="pull-right">
<a ng-click="scrollto('viewlptop')"><i class="fa fa-upload"></i>{{'label.button.top' | translate}}</a>
</td>
</tr>
</table>
</div>

View File

@ -1,3 +1,4 @@
<div id="viewlptop"></div>
<div class="content-container">
<ul class="breadcrumb">
<li><a href="#/accounting">{{'label.anchor.accounting' | translate}}</a></li>
@ -43,6 +44,13 @@
<td class="pointer" data-ng-click="routeTo(accountClosure.id)">{{accountClosure.createdByUsername}}</td>
</tr>
</tbody>
<tr>
<td colspan="3">
</td>
<td class="pull-right">
<a ng-click="scrollto('viewlptop')"><i class="fa fa-upload"></i>{{'label.button.top' | translate}}</a>
</td>
</tr>
</table>
</div>
</div>

View File

@ -1,3 +1,4 @@
<div id="viewlptop"></div>
<div class="content-container" ng-controller="ViewReportsController">
<ul class="breadcrumb">
<li class="active">{{type}}</li>
@ -20,6 +21,13 @@
<td class="pointer" data-ng-click="routeTo(report)">{{report.report_category}}</td>
</tr>
</tbody>
<tr>
<td colspan="2">
</td>
<td class="pull-right">
<a ng-click="scrollto('viewlptop')"><i class="fa fa-upload"></i>{{'label.button.top' | translate}}</a>
</td>
</tr>
</table>
<div ng-hide="true" ng-repeat="report in reports">
<input type="hidden" id="locale_name_{{$index}}" name="locale_name" ng-model="report.report_locale_name" value="{{report.report_name | translate}}" />