import m from 'mithril';
import _ from 'underscore';

const dropdown = {
    view(ctrl, args) {
        const opts = (_.isFunction(args.options) ? args.options() : args.options);

        return m(
            `select${args.classes}[id="${args.id}"]`,
            {
                onchange: (e) => { args.valueProp(e.target.value); args.onchange(); },
                value: args.valueProp()
            },
            _.map(opts, data => m(`option[value="${data.value}"]`, data.option))
        );
    }
};

export default dropdown;

@@ -439,25 +439,27 @@
 %3E m(
-%60
+'
 option
-%5B
+', %7B 
 value
-=%22$%7B
+: 
 data
@@ -464,20 +464,18 @@
 ta.value
+ 
 %7D
-%22%5D%60
 , data.o

fix report default option [#149840931]