Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsCurrent doesn't work when selection is reverse #3

Open
jedateach opened this issue Aug 29, 2014 · 3 comments
Open

IsCurrent doesn't work when selection is reverse #3

jedateach opened this issue Aug 29, 2014 · 3 comments
Labels
Milestone

Comments

@jedateach
Copy link
Contributor

When you click a sort option, the revere option shows up, but it doesn't get marked as the current option.

@jedateach jedateach added this to the 2.0.1 milestone Aug 29, 2014
@jedateach jedateach added the bug label Aug 29, 2014
@guci0
Copy link

guci0 commented Nov 24, 2016

Me too.

Trying...

`protected function isCurrent(ListSorter_Option $option)
{

    if (stripos($this->getCurrentOption(), "_") !== false) {
        
        //echo $option ."===". substr($this->getCurrentOption(), 0, -4) . "<br />";

        return $option === substr($this->getCurrentOption(), 0, -4);
        
    } else {
        //echo $option ."===". $this->getCurrentOption() . "<br />";

        return $option === $this->getCurrentOption();
    }
    
}`

won't work :(

@guci0
Copy link

guci0 commented Nov 24, 2016

Change === to == and works :) But still problems, ah. Click, & click – second click doesn't refresh

@seppzzz
Copy link

seppzzz commented Jun 5, 2017

maybe this is an alternative:
(with bootstrap 4)

<% if Sorter %> <div class="sorter"> <span calss="sorter_label">Sortieren:</span> <select class="custom-select" onchange="location = this.options[this.selectedIndex].value;"> <% loop Sorter.Sorts %> <option <% if IsCurrent %> selected="selected" <% end_if %> value="$Link">$Title</option> <% end_loop %> </select> </div> <% end_if %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants