Skip to content

Commit

Permalink
Don't allow keynavlist selection of empty value (Bug #13209)
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Jul 1, 2014
1 parent a80aa13 commit 057ccdc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions framework/Core/js/keynavlist.js
Expand Up @@ -103,6 +103,9 @@ var KeyNavList = Class.create({
v.l = v.l.escapeHTML().gsub(' ', '  ');
}
li = new Element('LI').insert(v.l).store('v', v.v);
if (v.v.empty()) {
li.addClassName('noselect');
}
if (v.s) {
this.markSelected(li);
}
Expand Down Expand Up @@ -233,6 +236,10 @@ var KeyNavList = Class.create({

if (elt &&
(elt == this.div || elt.descendantOf(this.div))) {
if (elt.retrieve('v').empty()) {
return;
}

this.markSelected(elt);
this.opts.onChoose(this.getCurrentEntry());
e.stop();
Expand Down
3 changes: 3 additions & 0 deletions horde/themes/default/screen.css
Expand Up @@ -1210,6 +1210,9 @@ ul.sound-list {
color: #000;
white-space: nowrap;
}
.KeyNavList ul li.noselect {
color: #888;
}
.KeyNavList ul li.selected {
background: #c2ccd0;
}
Expand Down

0 comments on commit 057ccdc

Please sign in to comment.