PATH:
usr
/
local
/
jetapps
/
frontend
/
jetbackup
/
app
/
directives
'use strict'; define([ 'app' ], function (app) { app.directive("sortBy", ["lang", function(lang) { var ASCENDING = "asc"; var DESCENDING = "desc"; var DEFAULT_ASCENDING_TITLE = lang.t("Ascending"); var DEFAULT_DESCENDING_TITLE = lang.t("Descending"); return { template: '<button class="sort-link" ng-click="sort(sortValue)">\n' + ' <span ng-transclude></span>\n' + ' <span ng-hide="sortMeta.getSortBy() !== sortField">\n' + ' <i class="fas" ng-class="{true: \'fa-sort-up\', false: \'fa-sort-down\'}[sortMeta.getSortDirection() == \'asc\']"\n' + ' ng-attr-title="{{ getTitle() }}"></i>\n' + ' </span>\n' + '</button>', restrict: "EA", transclude: true, replace: true, scope: { sortMeta: "=", sortType: "@", sortField: "@", sortReverse: "@", sortAscendingTitle: "@", sortDescendingTitle: "@", sortReverseDefault: "@", onsort: "&" }, compile: function (element, attributes) { if (!attributes["sortAscendingTitle"]) { attributes["sortAscendingTitle"] = DEFAULT_ASCENDING_TITLE; } if (!attributes["sortDescendingTitle"]) { attributes["sortDescendingTitle"] = DEFAULT_DESCENDING_TITLE; } return function (scope, element, attributes) { /** * Get the title text for the sort direction control. * * @method getTitle */ scope.getTitle = function () { return scope.sortMeta.getSortDirection() === ASCENDING ? attributes["sortAscendingTitle"] : attributes["sortDescendingTitle"]; }; /** * Toggle the sort direction on the selected column */ scope.sort = function () { var meta = scope.sortMeta; if (meta.getSortBy() === scope.sortField) { meta.setSortDirection(meta.getSortDirection() === ASCENDING ? DESCENDING : ASCENDING); } else { meta.setSortBy(scope.sortField); meta.setSortDirection(ASCENDING); } // Make sure onsort exists on the parent scope before executing it var onsort = scope.onsort(); if (angular.isFunction(onsort)) { onsort(meta); } }; } } } }]); });
[-] alertBox.js
[edit]
[+]
..
[-] sortBy.js
[edit]