Built motion from commit 1038d87.|0.0.141
[motion.git] / public / bower_components / angular-smart-table / smart-table.js
index e0246d4..871bb9c 100644 (file)
@@ -1,5 +1,5 @@
 /** 
-* @version 2.1.8
+* @version 2.1.5
 * @license MIT
 */
 (function (ng, undefined){
@@ -8,7 +8,7 @@
 ng.module('smart-table', []).run(['$templateCache', function ($templateCache) {
     $templateCache.put('template/smart-table/pagination.html',
         '<nav ng-if="numPages && pages.length >= 2"><ul class="pagination">' +
-        '<li ng-repeat="page in pages" ng-class="{active: page==currentPage}"><a href="javascript: void(0);" ng-click="selectPage(page)">{{page}}</a></li>' +
+        '<li ng-repeat="page in pages" ng-class="{active: page==currentPage}"><a ng-click="selectPage(page)">{{page}}</a></li>' +
         '</ul></nav>');
 }]);
 
@@ -31,7 +31,6 @@ ng.module('smart-table')
     sort: {
       ascentClass: 'st-sort-ascent',
       descentClass: 'st-sort-descent',
-      descendingFirst: false,
       skipNatural: false,
       delay:300
     },
@@ -345,7 +344,6 @@ ng.module('smart-table')
         var stateClasses = [classAscent, classDescent];
         var sortDefault;
         var skipNatural = attr.stSkipNatural !== undefined ? attr.stSkipNatural : stConfig.sort.skipNatural;
-        var descendingFirst = attr.stDescendingFirst !== undefined ? attr.stDescendingFirst : stConfig.sort.descendingFirst;
         var promise = null;
         var throttle = attr.stDelay || stConfig.sort.delay;
 
@@ -355,12 +353,7 @@ ng.module('smart-table')
 
         //view --> table state
         function sort () {
-          if (descendingFirst) {
-            index = index === 0 ? 2 : index - 1;
-          } else {
-            index++;
-          }
-
+          index++;
           var func;
           predicate = ng.isFunction(getter(scope)) || ng.isArray(getter(scope)) ? getter(scope) : attr.stSort;
           if (index % 3 === 0 && !!skipNatural !== true) {
@@ -376,7 +369,7 @@ ng.module('smart-table')
             $timeout.cancel(promise);
           }
           if (throttle < 0) {
-            func();
+            scope.$apply(func);
           } else {
             promise = $timeout(func, throttle);
           }
@@ -384,7 +377,7 @@ ng.module('smart-table')
 
         element.bind('click', function sortClick () {
           if (predicate) {
-            scope.$apply(sort);
+            sort();
           }
         });