Skip to content

Commit

Permalink
Merge pull request #7 from adrianschulz/master
Browse files Browse the repository at this point in the history
Merge back
  • Loading branch information
tomgross committed Jun 7, 2018
2 parents dfe9e61 + 1967ba9 commit 8a5eb8c
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Expand Up @@ -9,6 +9,10 @@ Changelog
- Same results-limit will be used in the view and the querybuilder.
- The sorting for every collection will be stored in it's own sorting field.
- "Sort on"-field has now an impact on the query & the results.
- "Sort on"- and "Sort order"-fields will be stored separate for every collection.
- The sorting will be updated always. Before this happend only while saving.
- Set automatically "Sort on"-field to None (which is necessary for d&d) when d&d is executed.
- Show correct sorting also if limit is smaller than the amount of results.
- Fix tests
[adrianschulz]

Expand Down
5 changes: 2 additions & 3 deletions src/collective/sortedlisting/browser/results.pt
Expand Up @@ -98,15 +98,14 @@
var updateSorting = function(el, shift){
/* Get active modal window */
var modal = $('div.plone-modal-wrapper:visible').first();
/*
Not in use to reduce the risk of an error in the next release.

if(modal.length == 0) {
modal = $('div.plone-modal-wrapper.mosaic-overlay');
}
if(modal.length == 0){
modal = $('div#content-core');
}
*/

var sortOnSelect = modal.find(".querystring-sort-wrapper").find("select")
var uid = $(el).attr('data-uid');
var uidList = modal.find("div#search-results li").map(function() {
Expand Down
Expand Up @@ -240,11 +240,9 @@ define('sortablequerystring',[
if(modal.length == 0) {
modal = $('div.plone-modal-wrapper.mosaic-overlay');
}
/*
if(modal.length == 0){
modal = $('div#content-core');
}
*/

var sorting = modal.find("textarea[name$='.sorting']").first().val();

Expand Down Expand Up @@ -278,11 +276,9 @@ define('sortablequerystring',[
if(modal.length == 0) {
modal = $('div.plone-modal-wrapper.mosaic-overlay');
}
/*
if(modal.length == 0){
modal = $('div#content-core');
}
*/

// elements that may exist already on the page
// XXX do this in a way so it'll work with other forms will work
Expand Down Expand Up @@ -333,8 +329,6 @@ define('sortablequerystring',[
.addClass(self.options.classSortReverseLabelName)
);

// if the form already contains the sort fields, hide them! Their values
// will be synced back and forth between the querystring's form elements
if (existingSortOn.length >= 1 && existingSortOrder.length >= 1) {
var reversed = $('.option input[type="checkbox"]', existingSortOrder).prop('checked');
var sortOn = $('[id$="-sort_on"]', existingSortOn).val();
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8a5eb8c

Please sign in to comment.