Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Instruments.prototype.sortInstruments = function (sortParam, desc) {
- var sortInstruments;
- if (!desc) {
- sortInstruments = _.sortBy(this.instruments.value, function (instrument) {
- return instrument[sortParam];
- });
- } else {
- sortInstruments = _.sortBy(this.instruments.value, function (instrument) {
- return instrument[sortParam];
- }).reverse();
- }
- this.instruments.value = sortInstruments;
- };
- Instruments.prototype.headClickCallback = function (id) {
- var desc;
- if (this.lastSortParam === id) {
- desc = true;
- this.lastSortParam = '';
- } else {
- desc = false;
- this.lastSortParam = id;
- }
- this.sortParam = id;
- this.sortInstruments(id, desc);
- this.setMode(this.currentMode);
- this.refreshPortfolioHoldings();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement