community-app/app/scripts/controllers/system/CodeController.js
pkt77 b184f394b0 MIFOSX-1686 More Search Retain and Clear Filters Button
Part of GCI task:
https://www.google-melange.com/gci/task/view/google/gci2014/6693211636498432

- Almost all search/filter pages save data. I had a problem with
ClienController and UserListController during npm test. Couldn't figure
out why it didn't like the new code... Hope you guys can have a look at
them.

- MainController   removed pointless if statement

- In some filter views, you can search for a selection option (offices
for example). That search box had a search icon with 2 pixels above it.
Those 2 pixels are from X in the chosen-sprite.png above the search
icon. Those have been trimmed.

- Other formatting changes
2014-12-14 15:07:10 -05:00

29 lines
1017 B
JavaScript

(function (module) {
mifosX.controllers = _.extend(module, {
CodeController: function (scope, resourceFactory, location) {
scope.codes = [];
scope.routeTo = function (id) {
location.path('/viewcode/' + id);
}
if (!scope.searchCriteria.codes) {
scope.searchCriteria.codes = null;
scope.saveSC();
}
scope.filterText = scope.searchCriteria.codes;
scope.onFilter = function () {
scope.searchCriteria.codes = scope.filterText;
scope.saveSC();
};
resourceFactory.codeResources.getAllCodes(function (data) {
scope.codes = data;
});
}
});
mifosX.ng.application.controller('CodeController', ['$scope', 'ResourceFactory', '$location', mifosX.controllers.CodeController]).run(function ($log) {
$log.info("CodeController initialized");
});
}(mifosX.controllers || {}));