mirror of
https://github.com/moparisthebest/mail
synced 2025-02-27 08:11:44 -05:00
Broadcast search event from action bar to filter mail-list
This commit is contained in:
parent
4edf79d8c4
commit
e8e69ad32d
@ -156,6 +156,13 @@ var ActionBarCtrl = function($scope, email, dialog, statusDisplay) {
|
|||||||
return message.checked;
|
return message.checked;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called when the user changes the searchText
|
||||||
|
*/
|
||||||
|
$scope.displaySearchResults = function(searchText) {
|
||||||
|
$scope.$root.$broadcast('search', searchText);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ActionBarCtrl;
|
module.exports = ActionBarCtrl;
|
@ -177,6 +177,13 @@ var MailListCtrl = function($scope, $timeout, $routeParams, $filter, statusDispl
|
|||||||
Array.prototype.push.apply($scope.displayMessages, next);
|
Array.prototype.push.apply($scope.displayMessages, next);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle search event in other parts of the app by filtering messages in the mail-list
|
||||||
|
*/
|
||||||
|
$scope.$on('search', function(e, query) {
|
||||||
|
$scope.displaySearchResults(query);
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called when the user changes the searchText
|
* This method is called when the user changes the searchText
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user