Commit c0273d88 by Rashid Khan

fixed visual inconsistencies in the stringquery panel when using multiple queries

parent ae2a3ee8
<div class="row-fluid">
<div class="span3">
<label class="small">Allow Mulitple</label><input type="checkbox" ng-model="panel.multi" ng-checked="panel.multi">
<label class="small">Mulit Query</label><input type="checkbox" ng-change="set_multi(panel.multi) "ng-model="panel.multi" ng-checked="panel.multi">
</div>
<div class="span4" ng-show="panel.multi">
<label class="small">Multiquery Arrangement</label>
......
<kibana-panel ng-controller='stringquery'>
<div ng-switch="_.isArray(panel.query)">
<div ng-switch-when="false">
<form class="input-append" style="margin-bottom:0px; width:100%; white-space:nowrap;">
<div ng-show="!panel.multi">
<form class="input-append" style="margin-bottom:0px; width:100%;z-index:1000;overflow:auto">
<label><small>{{panel.label}}</small></label>
<input type="text" ng-model="panel.query" style="width:85%">
<button type="submit" class="btn btn-info" ng-click="send_query(panel.query)"><i class="icon-search"></i></button>
......@@ -9,7 +8,7 @@
<button ng-show="panel.multi" type="submit" class="btn" ng-click="add_query()"><i class="icon-plus"></i></button>
</form>
</div>
<div ng-switch-when="true">
<div ng-show="panel.multi">
<form ng-class="{'form-inline': panel.multi_arrange == 'horizontal'}" style="width:100%;" >
<span ng-repeat="q in panel.query">
<span class="input-append" style="margin-bottom:0px;margin-right:5px">
......@@ -22,5 +21,4 @@
<button type="submit" class="btn btn-info" ng-click="send_query(panel.query)"><i class="icon-search"></i> Search</button>
<button type="submit" class="btn" ng-click="send_query(panel.query);add_query();"><i class="icon-plus"></i> Add Query</button>
</div>
</div>
</kibana-panel>
\ No newline at end of file
......@@ -35,8 +35,14 @@ angular.module('kibana.stringquery', [])
}
}
$scope.set_multi = function(multi) {
$scope.panel.query = multi ?
new Array($scope.panel.query) : $scope.panel.query[0];
}
$scope.remove_query = function(index) {
$scope.panel.query.splice(index,1);
console.log($scope.panel.query)
}
$scope.init();
......
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