summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rwxr-xr-xdemos/declarative/samegame/content/samegame.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/demos/declarative/samegame/content/samegame.js b/demos/declarative/samegame/content/samegame.js
index 41ed84c..c0f10bd 100755
--- a/demos/declarative/samegame/content/samegame.js
+++ b/demos/declarative/samegame/content/samegame.js
@@ -222,8 +222,9 @@ function saveHighScore(name) {
tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)');
tx.executeSql(dataStr, data);
- var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "12x17" ORDER BY score desc LIMIT 10');
- var r = "\nHIGH SCORES for a standard sized grid\n\n"
+ //Only show results for the current grid size
+ var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "'+maxX+"x"+maxY+'" ORDER BY score desc LIMIT 10');
+ var r = "\nHIGH SCORES for this grid size\n\n"
for(var i = 0; i < rs.rows.length; i++){
r += (i+1)+". " + rs.rows.item(i).name +' got '
+ rs.rows.item(i).score + ' points in '