/*global $*/
const m = require('mithril');

const ItemsCount = module.exports = {};

ItemsCount.view = function (ctrl, args) {
  const ITEMS_PER_PAGE = args.possibleItemsPerPage;
  let currentItemsPerPage = parseInt(args.itemsPerPage());

  let getItemsCountSelect = function () {
    let selectConfig = {
      config: () => { $('select').material_select(); }, // for materialize-css
      onchange: m.withAttr('value', args.itemsPerPage)
    };

    return [
      m('select', selectConfig, ITEMS_PER_PAGE.map(function (count) {
        return count === currentItemsPerPage ?
            m('option', {value: count, selected: true}, count) :
            m('option', {value: count}, count);
      })),
      m('label', 'Items per Page')
    ];
  };

  return m('div', {className: 'row right-align'}, [
    m('div', {id: 'itemsCount', className: 'input-field col s1 offset-s11'},
        getItemsCountSelect()
    )
  ]);
};

@@ -1,17 +1,4 @@
-/*global $*/%0A
 cons
@@ -24,16 +24,56 @@
 ril');%0A%0A
+const mz = require('../utils/mzInit');%0A%0A
 const It
@@ -291,233 +291,63 @@
 t = 
-function () %7B%0A    let selectConfig = %7B%0A      config: () =%3E %7B $('select').material_select(); %7D, // for materialize-css%0A      onchange: m.withAttr('value', args.itemsPerPage)%0A    %7D;%0A%0A    return %5B%0A      m('select', selectConfig,
+%5B%0A    m('select', mz.select(args.itemsPerPage),%0A       
  ITE
@@ -366,25 +366,16 @@
 map(
-function 
 (count) 
 %7B%0A  
@@ -370,17 +370,18 @@
 (count) 
-%7B
+=%3E
 %0A       
@@ -381,22 +381,19 @@
         
-return
+   
  count =
@@ -417,16 +417,20 @@
 rPage ?%0A
+    
         
@@ -490,32 +490,36 @@
 ) :%0A            
+   
+ 
 m('option', %7Bval
@@ -540,23 +540,21 @@
 unt)
-;
 %0A      
-%7D
+  
 )),%0A
-  
     
@@ -586,19 +586,12 @@
 e')%0A
-  
   %5D;
-%0A  %7D;
 %0A%0A  
@@ -717,16 +717,16 @@
 -s11'%7D,%0A
+
         
@@ -744,18 +744,16 @@
 ntSelect
-()
 %0A    )%0A 

Use mz.select and refactor