| Index: lib/ui.js |
| =================================================================== |
| --- a/lib/ui.js |
| +++ b/lib/ui.js |
| @@ -186,21 +186,31 @@ let optionsObserver = |
| if (currentSubscription && list.selectedIndex < 0) |
| { |
| list.appendItem(currentSubscription.title, currentSubscription.url, null); |
| list.selectedIndex = list.itemCount - 1; |
| } |
| } |
| - list.addEventListener("command", function(event) |
| + var listener = function() |
| { |
| if (list.value) |
| UI.setSubscription(list.value, list.label); |
| - }, false); |
| + } |
| + list.addEventListener("command", listener, false); |
| + |
| + // xul:menulist in Fennec is broken and doesn't trigger any events |
| + // on selection. Have to detect selectIndex changes instead. |
| + // See http://hg.mozilla.org/mozilla-central/file/04d8c309fe72/mobile/android/chrome/content/SelectHelper.js#l40 |
| + list.watch("selectedIndex", function(prop, oldval, newval) |
| + { |
| + Utils.runAsync(listener); |
| + return newval; |
| + }); |
| }, false); |
| request.send(); |
| } |
| } |
| }, |
| observe: function(subject, topic, data) |
| { |