Commit 03390266 by Torkel Ödegaard

fix(default datasource): minor fix for handling of default datasource

parent 2f5115ca
...@@ -15,18 +15,10 @@ ...@@ -15,18 +15,10 @@
<i class="fa fa-bars"></i> <i class="fa fa-bars"></i>
</a> </a>
<ul class="dropdown-menu pull-right" role="menu"> <ul class="dropdown-menu pull-right" role="menu">
<a tabindex="1" ng-click="toggleEditorMode()"> <li role="menuitem"><a tabindex="1" ng-click="toggleQueryMode()">Switch editor mode</a></li>
Switch editor mode <li role="menuitem"><a tabindex="1" ng-click="duplicate()">Duplicate</a></li>
</a> <li role="menuitem"><a tabindex="1" ng-click="moveMetricQuery($index, $index-1)">Move up</a></li>
<li role="menuitem"> <li role="menuitem"><a tabindex="1" ng-click="moveMetricQuery($index, $index+1)">Move down</a></li>
<a tabindex="1" ng-click="duplicate()">Duplicate</a>
</li>
<li role="menuitem">
<a tabindex="1" ng-click="moveMetricQuery($index, $index-1)">Move up</a>
</li>
<li role="menuitem">
<a tabindex="1" ng-click="moveMetricQuery($index, $index+1)">Move down</a>
</li>
</ul> </ul>
</div> </div>
</li> </li>
......
<div class="tight-form"> <div class="tight-form">
<ul class="tight-form-list pull-right"> <ul class="tight-form-list pull-right">
<li class="tight-form-item small" ng-show="target.datasource">
<em>{{target.datasource}}</em>
</li>
<li class="tight-form-item"> <li class="tight-form-item">
<div class="dropdown"> <div class="dropdown">
<a class="pointer dropdown-toggle" <a class="pointer dropdown-toggle" data-toggle="dropdown" tabindex="1">
data-toggle="dropdown"
tabindex="1">
<i class="fa fa-bars"></i> <i class="fa fa-bars"></i>
</a> </a>
<ul class="dropdown-menu pull-right" role="menu"> <ul class="dropdown-menu pull-right" role="menu">
<li role="menuitem"><a tabindex="1" ng-click="toggleQueryMode()">Switch editor mode</a></li>
<li role="menuitem"><a tabindex="1" ng-click="duplicate()">Duplicate</a></li> <li role="menuitem"><a tabindex="1" ng-click="duplicate()">Duplicate</a></li>
<li role="menuitem"><a tabindex="1" ng-click="showQuery()" ng-hide="target.rawQuery">Raw query mode</a></li>
<li role="menuitem"><a tabindex="1" ng-click="hideQuery()" ng-show="target.rawQuery">Query editor mode</a></li>
<li role="menuitem"><a tabindex="1" ng-click="moveMetricQuery($index, $index-1)">Move up </a></li> <li role="menuitem"><a tabindex="1" ng-click="moveMetricQuery($index, $index-1)">Move up </a></li>
<li role="menuitem"><a tabindex="1" ng-click="moveMetricQuery($index, $index+1)">Move down</a></li> <li role="menuitem"><a tabindex="1" ng-click="moveMetricQuery($index, $index+1)">Move down</a></li>
</ul> </ul>
...@@ -35,19 +35,13 @@ ...@@ -35,19 +35,13 @@
</ul> </ul>
<!-- Raw Query mode --> <!-- Raw Query mode -->
<ul class="tight-form-list" ng-show="target.rawQuery"> <input type="text" class="tight-form-clear-input" style="width: 80%" ng-model="target.query"
<li> placeholder="select ..." ng-show="target.rawQuery"
<input type="text" give-focus="target.rawQuery"
class="tight-form-input span10" spellcheck='false'
ng-model="target.query" data-min-length=0 data-items=100
placeholder="select ..." ng-model-onblur
give-focus="target.rawQuery" ng-blur="get_data()"></input>
spellcheck='false'
data-min-length=0 data-items=100
ng-model-onblur
ng-blur="get_data()">
</li>
</ul>
<!-- Query editor mode --> <!-- Query editor mode -->
<ul class="tight-form-list" role="menu" ng-hide="target.rawQuery"> <ul class="tight-form-list" role="menu" ng-hide="target.rawQuery">
......
...@@ -30,8 +30,6 @@ function (angular, _) { ...@@ -30,8 +30,6 @@ function (angular, _) {
delete target.groupby_field_add; delete target.groupby_field_add;
} }
$scope.rawQuery = false;
$scope.functions = [ $scope.functions = [
'count', 'mean', 'sum', 'min', 'count', 'mean', 'sum', 'min',
'max', 'mode', 'distinct', 'median', 'max', 'mode', 'distinct', 'median',
...@@ -46,12 +44,8 @@ function (angular, _) { ...@@ -46,12 +44,8 @@ function (angular, _) {
}); });
}; };
$scope.showQuery = function () { $scope.toggleQueryMode = function () {
$scope.target.rawQuery = true; $scope.target.rawQuery = !$scope.target.rawQuery;
};
$scope.hideQuery = function () {
$scope.target.rawQuery = false;
}; };
// Cannot use typeahead and ng-change on blur at the same time // Cannot use typeahead and ng-change on blur at the same time
......
<div class="tight-form"> <div class="tight-form">
<ul class="tight-form-list pull-right"> <ul class="tight-form-list pull-right">
<li class="tight-form-item small" ng-show="target.datasource">
<em>{{target.datasource}}</em>
</li>
<li class="tight-form-item"> <li class="tight-form-item">
<div class="dropdown"> <div class="dropdown">
<a class="pointer dropdown-toggle" data-toggle="dropdown" tabindex="1"> <a class="pointer dropdown-toggle" data-toggle="dropdown" tabindex="1">
......
<div class="tight-form"> <div class="tight-form">
<ul class="tight-form-list pull-right"> <ul class="tight-form-list pull-right">
<li class="tight-form-item small" ng-show="target.datasource">
<em>{{target.datasource}}</em>
</li>
<li class="tight-form-item"> <li class="tight-form-item">
<div class="dropdown"> <div class="dropdown">
<a class="pointer dropdown-toggle" <a class="pointer dropdown-toggle" data-toggle="dropdown" tabindex="1">
data-toggle="dropdown"
tabindex="1">
<i class="fa fa-bars"></i> <i class="fa fa-bars"></i>
</a> </a>
<ul class="dropdown-menu pull-right" role="menu"> <ul class="dropdown-menu pull-right" role="menu">
<li role="menuitem"> <li role="menuitem">
<a tabindex="1" <a tabindex="1" ng-click="duplicate()">
ng-click="duplicate()">
Duplicate Duplicate
</a> </a>
</li> </li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment