projects
/
mkws-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
1164a77
)
Rationalise the confusion between mkws_config.sort_default and mkws.sort.
author
Mike Taylor
<mike@indexdata.com>
Fri, 6 Dec 2013 15:30:00 +0000
(15:30 +0000)
committer
Mike Taylor
<mike@indexdata.com>
Fri, 6 Dec 2013 15:30:00 +0000
(15:30 +0000)
tools/htdocs/mkws.js
patch
|
blob
|
history
diff --git
a/tools/htdocs/mkws.js
b/tools/htdocs/mkws.js
index
1a80b10
..
9ffe3e1
100644
(file)
--- a/
tools/htdocs/mkws.js
+++ b/
tools/htdocs/mkws.js
@@
-193,6
+193,9
@@
Handlebars.registerHelper('commaList', function(items, options) {
}
}
}
}
+mkws.sort = mkws_config.sort_default;
+debug("copied mkws_config.sort_default '" + mkws_config.sort_default + "' to mkws.sort");
+
if (mkws_config.query_width < 5 || mkws_config.query_width > 150) {
debug("Reset query width: " + mkws_config.query_width);
mkws_config.query_width = 50;
if (mkws_config.query_width < 5 || mkws_config.query_width > 150) {
debug("Reset query width: " + mkws_config.query_width);
mkws_config.query_width = 50;
@@
-952,7
+955,7
@@
function mkws_html_switch() {
}
function mkws_html_sort() {
}
function mkws_html_sort() {
- debug("HTML sort");
+ debug("HTML sort, mkws.sort = '" + mkws.sort + "'");
var sort_html = '<select name="mkwsSort" id="mkwsSort">';
for(var i = 0; i < mkws_config.sort_options.length; i++) {
var sort_html = '<select name="mkwsSort" id="mkwsSort">';
for(var i = 0; i < mkws_config.sort_options.length; i++) {
@@
-961,7
+964,7
@@
function mkws_html_sort() {
var val = opt.length == 1 ? opt[0] : opt[1];
sort_html += '<option value="' + key + '"';
var val = opt.length == 1 ? opt[0] : opt[1];
sort_html += '<option value="' + key + '"';
- if (key == mkws_config.sort_default) {
+ if (mkws.sort == key || mkws.sort == val) {
sort_html += ' selected="selected"';
}
sort_html += '>' + M(val) + '</option>';
sort_html += ' selected="selected"';
}
sort_html += '>' + M(val) + '</option>';