1
0
mirror of https://github.com/nextcloud/ocsms.git synced 2026-08-21 13:23:04 +00:00

Simpler implementation for search & show search but it's not working yet

This commit is contained in:
Loic Blot
2016-12-15 23:16:08 +01:00
parent 4606fd1d39
commit 6527fe2d90
2 changed files with 17 additions and 33 deletions
+8 -27
View File
@@ -39,31 +39,6 @@ function toBool(str) {
return null;
}
var SearchProxy = {};
(function(OC, _) {
'use strict';
var filter = function() {};
SearchProxy = {
attach: function(search) {
search.setFilter('phone', this.filterProxy);
},
filterProxy: function(query) {
filter(query);
},
setFilter: function(newFilter) {
filter = newFilter;
}
};
if (!_.isUndefined(OC.Plugins)) {
OC.Plugins.register('OCA.Search', SearchProxy);
}
})(OC, _);
app.directive('toInt', function() {
return {
require: 'ngModel',
@@ -127,6 +102,7 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile'
$scope.totalMessageCount = 0;
$scope.photoVersion = 1;
$scope.selectedContact = {};
$scope.lastSearch = '';
// Settings
$scope.sendCountry = function () {
@@ -313,9 +289,14 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile'
};
$scope.filterSms = function (query) {
alert('scope filter');
if (query != $scope.lastSearch) {
}
};
SearchProxy.setFilter($scope.filterSms);
OC.Plugins.register('OCA.Search', {
attach: function(search) {
search.setFilter('sms', $scope.filterSms);
}
});
/*
* Contact list management