From 694e8b03515f25e36cef855eddb835355eff4c51 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 13 Jan 2013 10:58:05 +0100 Subject: PagingTableService: o Adding support for showing a spinner if the query takes more than 500ms. o Adding a spinner when searching for people. --- src/main/resources/webapp/apps/app.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/main/resources/webapp/apps/app.js') diff --git a/src/main/resources/webapp/apps/app.js b/src/main/resources/webapp/apps/app.js index f74206c..8896d33 100755 --- a/src/main/resources/webapp/apps/app.js +++ b/src/main/resources/webapp/apps/app.js @@ -107,3 +107,31 @@ directives.directive('dogtagxl', function () { templateUrl: '/apps/dogtagBig.html' } }); + +directives.directive('spinner', function () { + return function($scope, element, attr) { + var opts = { + lines: 13, // The number of lines to draw + length: 7, // The length of each line + width: 4, // The line thickness + radius: 10, // The radius of the inner circle + corners: 1, // Corner roundness (0..1) + rotate: 0, // The rotation offset + color: '#000', // #rgb or #rrggbb + speed: 1, // Rounds per second + trail: 60, // Afterglow percentage + shadow: false, // Whether to render a shadow + hwaccel: false, // Whether to use hardware acceleration + className: attr.spinnerClass || 'spinner', // The CSS class to assign to the spinner + zIndex: 2e9, // The z-index (defaults to 2000000000) + top: attr.spinnerTop || 'auto', // Top position relative to parent in px + left: attr.spinnerLeft || 'auto' // Left position relative to parent in px + }; + + console.log("attr.spinnerTop =", attr.spinnerTop, "attr.spinnerLeft =", attr.spinnerLeft); + + var target = element[0]; + new Spinner(opts).spin(target); + return target; + } +}); -- cgit v1.2.3