Mercurial > hg > ltpdarepo
changeset 58:bce8c427a5c5
Integrate dropdown widget into query widget.
author | Daniele Nicolodi <daniele@grinta.net> |
---|---|
date | Sat, 13 Aug 2011 20:27:24 +0200 |
parents | 84c1573a3e97 |
children | 2850a914aef9 |
files | src/ltpdarepo/static/querywidget.js src/ltpdarepo/templates/query.html |
diffstat | 2 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ltpdarepo/static/querywidget.js Sat Aug 13 20:27:24 2011 +0200 +++ b/src/ltpdarepo/static/querywidget.js Sat Aug 13 20:27:24 2011 +0200 @@ -100,6 +100,7 @@ newcriteria.append($(document.createElement('input')) .attr({'value': '\u00D7', 'type': 'button', 'name': 'remove'}) .addClass('querywidget remove')); + $.dropdown.replace($("select", newcriteria)); $('#criteria').append(newcriteria); $(this).val(''); $(this).change();
--- a/src/ltpdarepo/templates/query.html Sat Aug 13 20:27:24 2011 +0200 +++ b/src/ltpdarepo/templates/query.html Sat Aug 13 20:27:24 2011 +0200 @@ -1,10 +1,15 @@ {% extends "objs.html" %} {% block head %} + <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='dropdown.css') }}"></link> <script type="text/javascript" src="{{ url_for('static', filename='jquery.js') }}"></script> + <script type="text/javascript" src="{{ url_for('static', filename='dropdown.js') }}"></script> <script type="text/javascript" src="{{ url_for('static', filename='querywidget.js') }}"></script> <script type="text/javascript"> var criteria = {{ criteria|tojson|safe }}; + $(function () { + $.dropdown.replace($("select")); + }); </script> {% endblock %}