(function() { var activate, handleClick, renderTemplate, indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; scrivito.editors.multienum_editor = { can_edit: function(element) { return $(element).is('[data-scrivito-field-type=multienum]'); }, activate: function(element) { return activate($(element)); } }; scrivito.on('load', function() { return scrivito.define_editor('multienum', scrivito.editors.enum_editor); }); activate = function(cmsField) { cmsField.html(renderTemplate(cmsField.scrivito('content'), cmsField.scrivito('valid_values'))); return cmsField.find('.scrivito_enum_editor li').on('click', function() { return handleClick(cmsField, $(this)); }); }; renderTemplate = function(values, validValues) { var i, len, li, ul, validValue; ul = $('