diff options
author | 2017-05-04 07:48:42 -0400 | |
---|---|---|
committer | 2017-05-04 12:28:17 -0400 | |
commit | b54df0ddd0c6a0372327c5aa3668e5a6458fcd64 (patch) | |
tree | e69cfa9b314a801bd187cf0145d1d4306436229c /ecomp-portal-FE/client/bower_components/angular-smart-table/src/stSearch.js | |
parent | 39d1e62c84041831bfc52cca73b5ed5efaf57d27 (diff) |
[PORTAL-7] Rebase
This rebasing includes common libraries and common overlays projects
abstraction of components
Change-Id: I9a24a338665c7cd058978e8636bc412d9e2fdce8
Signed-off-by: st782s <statta@research.att.com>
Diffstat (limited to 'ecomp-portal-FE/client/bower_components/angular-smart-table/src/stSearch.js')
-rw-r--r-- | ecomp-portal-FE/client/bower_components/angular-smart-table/src/stSearch.js | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/ecomp-portal-FE/client/bower_components/angular-smart-table/src/stSearch.js b/ecomp-portal-FE/client/bower_components/angular-smart-table/src/stSearch.js deleted file mode 100644 index 6105fbe6..00000000 --- a/ecomp-portal-FE/client/bower_components/angular-smart-table/src/stSearch.js +++ /dev/null @@ -1,43 +0,0 @@ -ng.module('smart-table') - .directive('stSearch', ['stConfig', '$timeout','$parse', function (stConfig, $timeout, $parse) { - return { - require: '^stTable', - link: function (scope, element, attr, ctrl) { - var tableCtrl = ctrl; - var promise = null; - var throttle = attr.stDelay || stConfig.search.delay; - var event = attr.stInputEvent || stConfig.search.inputEvent; - - attr.$observe('stSearch', function (newValue, oldValue) { - var input = element[0].value; - if (newValue !== oldValue && input) { - ctrl.tableState().search = {}; - tableCtrl.search(input, newValue); - } - }); - - //table state -> view - scope.$watch(function () { - return ctrl.tableState().search; - }, function (newValue, oldValue) { - var predicateExpression = attr.stSearch || '$'; - if (newValue.predicateObject && $parse(predicateExpression)(newValue.predicateObject) !== element[0].value) { - element[0].value = $parse(predicateExpression)(newValue.predicateObject) || ''; - } - }, true); - - // view -> table state - element.bind(event, function (evt) { - evt = evt.originalEvent || evt; - if (promise !== null) { - $timeout.cancel(promise); - } - - promise = $timeout(function () { - tableCtrl.search(evt.target.value, attr.stSearch || ''); - promise = null; - }, throttle); - }); - } - }; - }]); |