Commit 24c29e1f authored by Łukasz Nowak's avatar Łukasz Nowak

Fix hashchange.

Register function to hashchange event, not its result.

Simplify: control all by hashchange and just call it on load.
parent bc339b13
......@@ -48,7 +48,9 @@
<h1 i18n:translate="" i18n:domain="ui">Request a Software Instance</h1>\n
<div id="js_container"></div>\n
<script type="text/javascript">\n
$(document).ready(mainController());\n
$.ajaxSetup ({cache: false});\n
$(window).hashchange(hashController);\n
$(window).hashchange();\n
</script>\n
</div>\n
</tal:block>\n
......
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts21375380.89</string> </value>
<value> <string>ts21437496.66</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -213,8 +213,6 @@ function hashController ()\n
{\n
hash = window.location.hash;\n
}\n
\n
console.log(\'In hashController with \' + hash);\n
\n
var list_len = hash_list.length; \n
var i = 0;\n
......@@ -227,15 +225,7 @@ function hashController ()\n
break;\n
}\n
}\n
}\n
\n
function mainController() {\n
console.log(\'In mainController with \' + window.location.hash);\n
$.ajaxSetup ({cache: false});\n
$(window).hashchange( hashController() );\n
$(window).hashchange();\n
}\n
}
]]></string> </value>
</item>
......@@ -245,7 +235,7 @@ function mainController() {\n
</item>
<item>
<key> <string>size</string> </key>
<value> <int>6102</int> </value>
<value> <int>5853</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
329
\ No newline at end of file
330
\ No newline at end of file
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