Bug 1185110 - Shorten the IDs for the quick filter field

This commit is contained in:
Scriptofer 2015-07-24 19:04:40 +05:30
Родитель e5484eed06
Коммит e5ce9b8c1b
4 изменённых файлов: 16 добавлений и 17 удалений

Просмотреть файл

@ -219,28 +219,28 @@ th-watched-repo {
color: lightgray;
}
#platform-job-text-search-field {
#quick-filter {
height:28px;
width: 150px;
display: inherit;
transition: width 0.2s;
}
#platform-job-text-search-field-parent {
#quick-filter-parent {
position: relative;
}
#platform-job-text-search-field:focus,
#platform-job-text-search-field:valid {
#quick-filter:focus,
#quick-filter:valid {
width: 300px !important;
padding-right: 20px;
}
#platform-job-text-search-field:valid + #filter-clear-button {
#quick-filter:valid + #quick-filter-clear-button {
display: inherit;
}
#filter-clear-button {
#quick-filter-clear-button {
color: #bababa;
font-size: 13px;
cursor: pointer;

Просмотреть файл

@ -228,7 +228,7 @@ treeherderApp.controller('SearchCtrl', [
if (ev.keyCode === 13) {
var filterVal = $scope.searchQueryStr === ""? null: $scope.searchQueryStr;
thJobFilters.replaceFilter("searchStr", filterVal);
$rootScope.$broadcast('blur-this', "platform-job-text-search-field");
$rootScope.$broadcast('blur-this', "quick-filter");
}
};
}

Просмотреть файл

@ -62,7 +62,7 @@ treeherderApp.controller('MainCtrl', [
'u', // Display only unclassified failures
'b', // Pin selected job and add related bug
'c', // Pin selected job and add classification
'f', // Enter a custom job or platform filter
'f', // Enter a quick filter
'l' // Open the logviewer for the selected job
];
@ -198,15 +198,15 @@ treeherderApp.controller('MainCtrl', [
}
});
// Shortcut: enter a custom job or platform filter
// Shortcut: enter a quick filter
Mousetrap.bind('f', function(ev) {
// Prevent shortcut key overflow during focus
ev.preventDefault();
$('#platform-job-text-search-field').focus();
$('#quick-filter').focus();
});
// Shortcut: clear the custom filter field
// Shortcut: clear the quick filter field
Mousetrap.bind('ctrl+shift+f', function(ev) {
// Prevent shortcut key overflow during focus
ev.preventDefault();
@ -373,8 +373,7 @@ treeherderApp.controller('MainCtrl', [
$scope.clearFilterBox = function() {
thJobFilters.removeFilter("searchStr");
$("#platform-job-text-search-field").val("");
$('#platform-job-text-search-field').focus();
$("#quick-filter").val("").focus();
};
$scope.isFilterPanelShowing = false;

Просмотреть файл

@ -38,15 +38,15 @@
</span>
</span>
<!--Search Field-->
<span ng-controller="SearchCtrl" class="form-group form-inline" id="platform-job-text-search-field-parent">
<input id="platform-job-text-search-field"
<!--Quick Filter Field-->
<span ng-controller="SearchCtrl" class="form-group form-inline" id="quick-filter-parent">
<input id="quick-filter"
title="Click to enter filter values"
ng-model="searchQueryStr" ng-keydown="search($event)" type="text"
class="form-control input-sm" required
placeholder="Filter platforms & jobs"
blur-this>
<span id="filter-clear-button" class="fa fa-times-circle"
<span id="quick-filter-clear-button" class="fa fa-times-circle"
ng-click="clearFilterBox()" title="Clear this filter"></span>
</span>
</form>