diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-09-02 17:50:39 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-09-02 17:50:39 +0200 |
| commit | 0ab4b22639c1c513f3cbe9e5d5d5cabf8bd9e58d (patch) | |
| tree | bfa150ec22bc3ecb0232345de8b51c139555a305 /ishtar_common/templates | |
| parent | 1018402b846572b2bc348c0e6e0865527915afdb (diff) | |
| download | Ishtar-0ab4b22639c1c513f3cbe9e5d5d5cabf8bd9e58d.tar.bz2 Ishtar-0ab4b22639c1c513f3cbe9e5d5d5cabf8bd9e58d.zip | |
Widget: use a template for SquareMeterWidget
Diffstat (limited to 'ishtar_common/templates')
| -rw-r--r-- | ishtar_common/templates/blocks/SquareMeterWidget.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ishtar_common/templates/blocks/SquareMeterWidget.html b/ishtar_common/templates/blocks/SquareMeterWidget.html new file mode 100644 index 000000000..4302ee234 --- /dev/null +++ b/ishtar_common/templates/blocks/SquareMeterWidget.html @@ -0,0 +1,14 @@ +<input class="area_widget" type="text"{{final_attrs}}> {{unit}} (<span id="ha_{{id}}">0</span> ha) +<script type="text/javascript"><!--// + function evaluate_{{safe_id}}(){ + value = parseFloat($("#{{id}}").val()); + if(!isNaN(value)){ + value = value/10000; + } else { + value = 0; + } + $("#ha_{{id}}").html(value); + } + $("#{{id}}").keyup(evaluate_{{safe_id}}); + $(document).ready(evaluate_{{safe_id}}()); +//--></script> |
