summaryrefslogtreecommitdiff
path: root/xstatic/pkg/magic_search/data/magic_search_bootstrap.js
diff options
context:
space:
mode:
Diffstat (limited to 'xstatic/pkg/magic_search/data/magic_search_bootstrap.js')
-rwxr-xr-xxstatic/pkg/magic_search/data/magic_search_bootstrap.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/xstatic/pkg/magic_search/data/magic_search_bootstrap.js b/xstatic/pkg/magic_search/data/magic_search_bootstrap.js
new file mode 100755
index 0000000..69810fe
--- /dev/null
+++ b/xstatic/pkg/magic_search/data/magic_search_bootstrap.js
@@ -0,0 +1,28 @@
+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();
+ });
+
+ }
+ };
+ }); \ No newline at end of file