Skip to content

Commit

Permalink
Merge pull request #151 from google/150-timlinepicker-bug
Browse files Browse the repository at this point in the history
Timeline picker bug
  • Loading branch information
berggren committed Dec 4, 2015
2 parents f9461b0 + 5104f04 commit 9fa8dbf
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions timesketch/ui/static/components/explore/explore-search-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,24 @@ limitations under the License.
},
controllerAs: 'ctrl',
link: function(scope, elem, attrs, ctrl) {
if (attrs.autoload == 'true') {
timesketchApi.getView(attrs.sketchId, attrs.viewId).success(function(data) {
var query = data.objects[0].query_string;
var filter = angular.fromJson(data.objects[0].query_filter);
ctrl.search(query, filter);
});
}
if (attrs.redirect == 'true') {
scope.redirectView = true;
}
scope.$watch("sketch.views", function(value) {
if (!scope.filter.indices.length) {
return
}
if (attrs.autoload == 'true') {
timesketchApi.getView(attrs.sketchId, attrs.viewId).success(function(data) {
var query = data.objects[0].query_string;
var filter = angular.fromJson(data.objects[0].query_filter);
ctrl.search(query, filter);
});
}
if (attrs.redirect == 'true') {
scope.redirectView = true;
}
}, true);
},
controller: function($scope) {
$scope.filter = {"indices": []};

timesketchApi.getSketch($scope.sketchId).success(function(data) {
$scope.sketch = data.objects[0];
$scope.sketch.views = data.meta.views;
Expand Down

0 comments on commit 9fa8dbf

Please sign in to comment.