xstatic-magic-search/xstatic/pkg/magic_search/data/magic_search_bootstrap.js
Randy Bertram 1e15e5bbb5 Initializing with MagicSearch 0.1.5.9
First commit of MagicSearch code

Change-Id: Idc51127a72a0a80aab706690db26387cc9f72b81
2015-02-20 09:50:47 -05:00

28 lines
1.1 KiB
JavaScript
Executable File

angular.module('MagicSearch', ['ui.bootstrap'])
.directive('magicOverrides', function() {
return {
restrict: 'A',
controller: function($scope) {
// showMenu and hideMenu depend on foundation's dropdown. They need
// to be modified to work with another dropdown implemenation.
// For bootstrap, they are not needed at all.
$scope.showMenu = function() {
$scope.isMenuOpen = true;
};
$scope.hideMenu = function() {
$scope.isMenuOpen = false;
};
$scope.isMenuOpen = false;
// remove the following when magic_search.js handles changing the facets/options
$scope.$watch('facets_json', function(newVal, oldVal) {
if (newVal === oldVal) {
return;
}
$scope.currentSearch = [];
$scope.initSearch();
});
}
};
});