diff --git a/xstatic/pkg/magic_search/data/magic_search.js b/xstatic/pkg/magic_search/data/magic_search.js
index 347bb33..31f35e0 100644
--- a/xstatic/pkg/magic_search/data/magic_search.js
+++ b/xstatic/pkg/magic_search/data/magic_search.js
@@ -8,7 +8,7 @@
try{
angular.module('MagicSearch');
} catch (exception) {
- angular.module('MagicSearch', []);
+ angular.module('MagicSearch', []);
}
angular.module('MagicSearch')
@@ -23,8 +23,9 @@ angular.module('MagicSearch')
templateUrl: function (scope, elem) {
return elem.template;
},
- controller: function ($scope, $timeout) {
- $scope.promptString = $scope.strings['prompt'];
+ controller: function ($scope, $element, $timeout) {
+ var searchInput = $element.find('.search-input');
+ $scope.promptString = $scope.strings.prompt;
$scope.currentSearch = [];
$scope.initSearch = function() {
if (typeof $scope.facets_param === 'string') {
@@ -48,7 +49,7 @@ angular.module('MagicSearch')
initialFacets = initialFacets.split('&');
if (initialFacets.length > 1 || initialFacets[0].length > 0) {
$timeout(function() {
- $scope.strings['prompt'] = '';
+ $scope.strings.prompt = '';
});
}
angular.forEach(initialFacets, function(facet, idx) {
@@ -76,12 +77,18 @@ angular.module('MagicSearch')
});
});
if ($scope.textSearch !== undefined) {
- $scope.currentSearch.push({'name':'text='+$scope.textSearch, 'label':[$scope.strings['text'], $scope.textSearch]});
+ $scope.currentSearch.push({'name':'text='+$scope.textSearch, 'label':[$scope.strings.text, $scope.textSearch]});
}
$scope.filteredObj = $scope.facetsObj;
};
+ $scope.addFacets = function(facets) {
+ // add a facets javascript object to the existing list
+ for (var facet in facets) {
+ $scope.facetsObj.append(facet);
+ }
+ };
$scope.copyFacets = function(facets) {
- var ret = []
+ var ret = [];
for (var i=0; i