forked from extern/egroupware
* Add clear button to nextmatch search box for Firefox
This commit is contained in:
parent
a137491ec0
commit
928c61d4cf
@ -1929,6 +1929,29 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader,
|
||||
self.nextmatch.applyFilters({search: self.search.getValue()});
|
||||
}
|
||||
});
|
||||
// Firefox treats search differently. Add in the clear button.
|
||||
if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1)
|
||||
{
|
||||
this.search.input.on("keyup",
|
||||
function(event) {
|
||||
// Insert the button, if needed
|
||||
if(self.search.input.next('span').length == 0)
|
||||
{
|
||||
self.search.input.after(
|
||||
$j('<span class="ui-icon"></span>').click(
|
||||
function() {self.search.input.val('');}
|
||||
)
|
||||
);
|
||||
}
|
||||
if(event.which == 27) // Escape
|
||||
{
|
||||
// Excape clears search
|
||||
self.search.input.val('');
|
||||
}
|
||||
self.search.input.next('span').toggle(self.search.input.val() != '');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Add category
|
||||
if(!settings.no_cat) {
|
||||
|
@ -984,6 +984,16 @@ div.message.floating {
|
||||
.et2_nextmatch .nextmatch_header_row > div {
|
||||
display: inline-block;
|
||||
}
|
||||
/* Firefox only search clear button */
|
||||
.et2_nextmatch .nextmatch_header_row input[type="search"] + span {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
top: 4px;
|
||||
margin-left: -16px;
|
||||
/* Clear icon (x) ui-icon-clear */
|
||||
background-position: -80px -128px;
|
||||
}
|
||||
|
||||
/* Favorites */
|
||||
.nextmatch_header div[id$=favorite_wrapper] {
|
||||
margin-top: 6px;
|
||||
|
Loading…
Reference in New Issue
Block a user