Commit c6712c44 authored by Boris Kocherov's avatar Boris Kocherov Committed by Boris Kocherov

erp5_xhtml_style: add sort_option

parent 4f041144
......@@ -24,7 +24,7 @@
css_list_template css_list_template | python:['%s/erp5.css'%portal_path];
dummy python:css_list.extend(css_list_template);
global js_list js_list | python:[];
global js_list python: js_list + ['%s/%s' % (portal_path, x) for x in ('js/bootstrap-select.min.js', 'erp5_popup.js', 'js/bootstrap.min.js')];
global js_list python: js_list + ['%s/%s' % (portal_path, x) for x in ('sort_option.js', 'js/bootstrap-select.min.js', 'erp5_popup.js', 'js/bootstrap.min.js')];
global js_list python: ['%s/%s' % (portal_path, x) for x in portal.ERP5Site_getJavaScriptRelativeUrlList()] + js_list;
global http_parameter_list python: portal.ERP5Site_filterParameterList(request.form);
dummy python: http_parameter_list.update(local_parameter_list);
......
var sortOptionInSelect = function() {
var sort_select_box = function(index, elem) {
if (elem.size > 1) {
$(elem).append($('option', elem).sort(function(a, b){
if ( a.selected == b.selected ) return 0;
if ( a.selected > b.selected ) return -1;
if ( a.selected < b.selected ) return 1;
}));
}
};
$.fn.sort_select_box = function() {
$(this).each(sort_select_box);
};
$('select').sort_select_box();
};
$(document).ready(sortOptionInSelect);
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts59778905.02</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>sort_option.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>501</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>sort_option.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment