mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-29 06:25:18 -04:00
Add filter reset on location change.
This commit is contained in:
parent
af29d651b5
commit
a1ebf1f4fb
3 changed files with 41 additions and 2 deletions
|
@ -67,6 +67,11 @@ modulejs.define('ext/filter', ['_', '$', 'core/settings', 'core/resource', 'core
|
|||
return new RegExp(sequence, 'i');
|
||||
},
|
||||
|
||||
reset = function () {
|
||||
|
||||
$input.val('').blur();
|
||||
},
|
||||
|
||||
update = function (focus) {
|
||||
|
||||
var val = $input.val();
|
||||
|
@ -103,12 +108,12 @@ modulejs.define('ext/filter', ['_', '$', 'core/settings', 'core/resource', 'core
|
|||
.on('keydown', function (event) {
|
||||
|
||||
if (event.which === 27) {
|
||||
$input.val('').blur();
|
||||
reset();
|
||||
}
|
||||
})
|
||||
.on('keypress', updt);
|
||||
|
||||
event.sub('location.changed', updf);
|
||||
event.sub('location.changed', reset);
|
||||
};
|
||||
|
||||
init();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue