foodsoft/app/views/orders/_show_js.html.haml

21 lines
690 B
Text
Raw Permalink Normal View History

2015-02-19 00:53:57 +01:00
-# this needs to be in a separate file from show.html.erb to allow deface overrides
- content_for :javascript do
:javascript
function activate_search(view, placeholder) {
new List(document.body, {
valueNames: ['name'],
engine: 'unlist',
plugins: [
['reset', {highlightClass: 'btn-primary'}],
['delay', {delayedSearchTime: 500}],
],
// make large pages work too (as we don't have paging)
page: 10000,
indexAsync: true
});
$('#query').attr('placeholder', placeholder);
}
$(function() {
activate_search('#{j @view}', '#{j t("orders.show.search_placeholder.#{@view}")}');
2015-02-19 00:53:57 +01:00
});