Commit be2f30fc authored by Sven Franck's avatar Sven Franck

bugfix: don't reload jIO when going back and forth

parent 681af6a3
......@@ -223,7 +223,6 @@
//<![CDATA[
// initialize jio_config
if ($.fn.fauna.jio_item_config === undefined) {
$.fn.fauna.jio_item_config = jIO.newJio({
"type": "local",
"username": "item_config",
......@@ -294,8 +293,12 @@
.filter(function() { return $(this).jqmData('bound') !== true; })
.jqmData('bound', true)
.on('click', 'a', function (e) {
var m, formdata, ajaxObject;
e.preventDefault();
var m, formdata = $("form[name=compare]").serialize(),
// only pull once!
if ($.fn.fauna.items_loaded === undefined) {
$.fn.fauna.items_loaded = true;
formdata = $("form[name=compare]").serialize();
ajaxObject = {
url: "../data/stats.json",
type: "post",
......@@ -335,14 +338,19 @@
}
}
$.fn.util.spin('hide');
// go to results page
// go to results page, this should be inside search callback
$.mobile.changePage('results.html', {transition: 'fade'});
},
errorHandler : function (XMLHttpRequest, textStatus, errorThrown) {
//
}
};
// get records
$.fn.util.ajaxFormSubmit(ajaxObject);
} else {
// go to results page - inside a search callback!!!
$.mobile.changePage('results.html', {transition: 'fade'});
}
});
$(document).ready(function() {
......
......@@ -10,9 +10,9 @@ define([], function () {
function (i18n) {
var fauna = {}, // application environment (PUBLIC-settings)
flora = {
flora = { // user environment (PRIVATE)
items_good_until: new Date("March 20, 2013 00:00:00")
}, // user environment (PRIVATE)
},
util = {} // utility functions (PUBLIC)
util = {
......@@ -187,9 +187,6 @@ define([], function () {
// enhancing gadgets when everyone else is done
$(document).on('render_enhance', function(e, data) {
data.gadget.trigger("create");
// if (data.callback !== undefined) {
// data.callback();
// }
});
......
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