mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
cloudstack UI - listView widget - basic search - fix a bug that happened on IE browser that clicking Enter key didn't do the searching.
This commit is contained in:
parent
14dd9cd197
commit
edc6b4c6da
@ -669,7 +669,8 @@
|
|||||||
var $search = $('<div></div>').addClass('text-search reduced-hide');
|
var $search = $('<div></div>').addClass('text-search reduced-hide');
|
||||||
var $searchBar = $('<div></div>').addClass('search-bar reduced hide').appendTo($search);
|
var $searchBar = $('<div></div>').addClass('search-bar reduced hide').appendTo($search);
|
||||||
$searchBar.append('<input type="text" />');
|
$searchBar.append('<input type="text" />');
|
||||||
$search.append('<div class="button search"></div>');
|
$search.append('<div id="basic_search" class="button search"></div>');
|
||||||
|
//$search.append('<div id="advanced_search" class="button search"></div>');
|
||||||
|
|
||||||
return $search.appendTo($toolbar);
|
return $search.appendTo($toolbar);
|
||||||
};
|
};
|
||||||
@ -1316,7 +1317,7 @@
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
var search = function() {
|
var basicSearch = function() {
|
||||||
page = 1;
|
page = 1;
|
||||||
loadBody(
|
loadBody(
|
||||||
$table,
|
$table,
|
||||||
@ -1341,13 +1342,18 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
$listView.find('.search-bar input[type=text]').change(function(event) {
|
//basic search
|
||||||
search();
|
$listView.find('.search-bar input[type=text]').keyup(function(event) {
|
||||||
});
|
if(event.keyCode == 13) //13 is keycode of Enter key
|
||||||
|
basicSearch();
|
||||||
// Setup filter events
|
return true;
|
||||||
$listView.find('.button.search, select').bind('change', function(event) {
|
});
|
||||||
|
$listView.find('.button.search#basic_search').bind('click', function(event) {
|
||||||
|
basicSearch();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
$listView.find('select').bind('change', function(event) {
|
||||||
if ($(event.target).closest('.section-select').size()) return true;
|
if ($(event.target).closest('.section-select').size()) return true;
|
||||||
if ((event.type == 'click' ||
|
if ((event.type == 'click' ||
|
||||||
event.type == 'mouseup') &&
|
event.type == 'mouseup') &&
|
||||||
@ -1356,11 +1362,18 @@
|
|||||||
$(event.target).is('input')))
|
$(event.target).is('input')))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
search();
|
basicSearch();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//advanced search
|
||||||
|
/*
|
||||||
|
$listView.find('.button.search#advanced_search').bind('click', function(event) {
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
// Infinite scrolling event
|
// Infinite scrolling event
|
||||||
$listView.bind('scroll', function(event) {
|
$listView.bind('scroll', function(event) {
|
||||||
if (args.listView && args.listView.disableInfiniteScrolling) return false;
|
if (args.listView && args.listView.disableInfiniteScrolling) return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user