Skip to content

Commit

Permalink
Fixed issue with bad sort order after init
Browse files Browse the repository at this point in the history
  • Loading branch information
VOS Maintainer committed Sep 2, 2015
1 parent 5c2f612 commit 2a2535c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion binsrc/yacutia/dav/dav_browser.xsl
Expand Up @@ -468,8 +468,11 @@
self.dir_direction := get_keyword ('direction', state, case when (columnName = 'column_#4') then 'desc' else 'asc' end);
}
}
if (columnName = '')
{
columnName := self.dir_order;
}
}
else
{
if (self.dir_order = columnName)
Expand All @@ -480,13 +483,20 @@
}
}
if (not self.enabledColumn(columnName))
{
columnName := 'column_#1';
if (self.dir_order = columnName)
{
self.dir_direction := either (equ (self.dir_direction, 'asc'), 'desc', 'asc');
} else {
self.dir_direction := 'asc';
}
}
self.dir_order := columnName;
self.settings := WEBDAV.DBA.set_keyword ('orderBy', self.settings, self.dir_order);
self.settings := WEBDAV.DBA.set_keyword ('orderDirection', self.settings, self.dir_direction);
WEBDAV.DBA.settings_save (self.account_id, self.settings);
self.ds_items.vc_reset();
]]>
</v:method>

Expand Down
4 changes: 2 additions & 2 deletions binsrc/yacutia/dav/dav_state.js
Expand Up @@ -55,8 +55,8 @@ DAVSTATE.readState = function ()
{
if (!state) {
var state = new Object();
state.column = 'column_#1';
state.direction = 'asc';
state.column = 'column_#4';
state.direction = 'desc';
}
return state;
}
Expand Down

0 comments on commit 2a2535c

Please sign in to comment.