diff --git a/src/app/panels/query/module.html b/src/app/panels/query/module.html
index 879e4040769287..da1f67528c4d97 100755
--- a/src/app/panels/query/module.html
+++ b/src/app/panels/query/module.html
@@ -1,4 +1,12 @@
+
Pinned
-
- {{querySrv.list[id].alias || querySrv.list[id].query}}
+
+ {{querySrv.list[id].alias || querySrv.list[id].query}}
diff --git a/src/app/services/querySrv.js b/src/app/services/querySrv.js
index a945e50b7f8619..c2db58064d6a6d 100755
--- a/src/app/services/querySrv.js
+++ b/src/app/services/querySrv.js
@@ -22,6 +22,7 @@ function (angular, _, config) {
query: '*',
alias: '',
pin: false,
+ active: true,
type: 'lucene'
};
@@ -117,11 +118,11 @@ function (angular, _, config) {
switch(config.mode)
{
case 'all':
- return self.ids;
+ return _.pluck(_.where(self.list,{active:true}),'id');
case 'pinned':
- return _.pluck(_.where(self.list,{pin:true}),'id');
+ return _.pluck(_.where(self.list,{pin:true, active:true}),'id');
case 'unpinned':
- return _.difference(self.ids,_.pluck(_.where(self.list,{pin:true}),'id'));
+ return _.difference(self.ids,_.pluck(_.where(self.list,{pin:true, active:true}),'id'));
case 'selected':
return _.intersection(self.ids,config.ids);
default: