You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2012/10/03 00:39:29 UTC
git commit: cloudstack UI - advanced search - show advanced search
icon on listView only when advSearch property is specified.
Updated Branches:
refs/heads/master 751d391a3 -> 6266fcb8f
cloudstack UI - advanced search - show advanced search icon on listView only when advSearch property is specified.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/6266fcb8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/6266fcb8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/6266fcb8
Branch: refs/heads/master
Commit: 6266fcb8f716867988d30f9970f9c6f12a9f4ddc
Parents: 751d391
Author: Jessica Wang <je...@citrix.com>
Authored: Tue Oct 2 10:44:07 2012 -0700
Committer: Jessica Wang <je...@citrix.com>
Committed: Tue Oct 2 15:39:14 2012 -0700
----------------------------------------------------------------------
ui/scripts/storage.js | 4 ++--
ui/scripts/ui/widgets/listView.js | 9 ++++++---
2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6266fcb8/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 970eadc..c16e621 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -302,9 +302,9 @@
if(args.filterBy != null) {
if(args.filterBy.advSearch != null && typeof(args.filterBy.advSearch) == "object") {
for(var key in args.filterBy.advSearch) {
- if(key == 'tagKey')
+ if(key == 'tagKey' && args.filterBy.advSearch[key].length > 0)
array1.push("&tags[0].key=" + args.filterBy.advSearch[key]);
- else if(key == 'tagValue')
+ else if(key == 'tagValue' && args.filterBy.advSearch[key].length > 0)
array1.push("&tags[0].value=" + args.filterBy.advSearch[key]);
else if(args.filterBy.advSearch[key] != null && args.filterBy.advSearch[key].length > 0)
array1.push("&" + key + "=" + args.filterBy.advSearch[key]);
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6266fcb8/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index 425efce..ed81002 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -670,12 +670,15 @@
return $filters.appendTo($toolbar);
};
- var createSearchBar = function($toolbar) {
+ var createSearchBar = function($toolbar, listViewData) {
var $search = $('<div></div>').addClass('text-search reduced-hide');
var $searchBar = $('<div></div>').addClass('search-bar reduced hide').appendTo($search);
$searchBar.append('<input type="text" />');
$search.append('<div id="basic_search" class="button search"></div>');
- //$search.append('<div id="advanced_search" class="button search"></div>');
+ /*
+ if(listViewData.advSearchFields != null)
+ $search.append('<div id="advanced_search" class="button search"></div>');
+ */
return $search.appendTo($toolbar);
};
@@ -1271,7 +1274,7 @@
listViewData.actions,
{ reorder: reorder });
createFilters($toolbar, listViewData.filters);
- createSearchBar($toolbar);
+ createSearchBar($toolbar, listViewData);
loadBody(
$table,