Files
aowow/static/widgets/searchbox/searchbox.js
Sarjuuk 93cc42407c menu more and tools
- items: allow 'upg' to be an array
- filter: fixed logic error in checks
- Markup: prevent handling of [menu], as PageTemplate is nyi
- Power: advanced features (hide reagents or sellprice; recoloring,
  renaming, iconizing of links)
- search: side-icon for titles
- smarty: added template-vars to cache (has to be fixed sooner or later)

- identify as HTML5 (fixed a strange bug with displaced list-pegs)
- removed several typos
2014-03-22 20:39:16 +01:00

38 lines
802 B
JavaScript

var SearchBox = new function () {
function bindEvents() {
$("form.search").submit(onSubmit);
$("form.search a").attr("href", "javascript:;").click(onClick);
}
function onSubmit() {
var val = this.elements.search.value;
if (!$.trim(val)) {
return false;
}
}
function onClick() {
$("form.search").submit();
return false;
}
$(document).ready(bindEvents);
};
if (!Function.prototype.bind) {
Function.prototype.bind = function () {
var
c = this,
a = $WH.$A(arguments),
b = a.shift();
return function () {
return c.apply(b, a.concat($WH.$A(arguments)))
};
}
}
function isset(a) {
return typeof window[a] != "undefined";
}