diff --git a/src/kibana/apps/discover/controllers/discover.js b/src/kibana/apps/discover/controllers/discover.js index 909673f4e11c..deb647d582bc 100644 --- a/src/kibana/apps/discover/controllers/discover.js +++ b/src/kibana/apps/discover/controllers/discover.js @@ -4,6 +4,8 @@ define(function (require) { var moment = require('moment'); var settingsHtml = require('text!../partials/settings.html'); var saveHtml = require('text!../partials/save_search.html'); + var loadHtml = require('text!../partials/load_search.html'); + var interval = require('utils/interval'); var datemath = require('utils/datemath'); @@ -58,6 +60,8 @@ define(function (require) { index: config.get('defaultIndex'), }; + console.log(stateDefaults); + var $state = $scope.state = new SyncedState(stateDefaults); // Check that we have any index patterns before going further, and that index being requested @@ -200,6 +204,15 @@ define(function (require) { } }; + $scope.toggleLoad = function () { + // Close if already open + if ($scope.configTemplate === loadHtml) { + delete $scope.configTemplate; + } else { + $scope.configTemplate = loadHtml; + } + }; + $scope.resetQuery = function () { $state.query = stateDefaults.query; $state.sort = stateDefaults.sort; diff --git a/src/kibana/apps/discover/index.html b/src/kibana/apps/discover/index.html index 44df79d1e0e4..ffc6a7ad13b5 100644 --- a/src/kibana/apps/discover/index.html +++ b/src/kibana/apps/discover/index.html @@ -3,6 +3,8 @@