Sha256: 62e8d1199baae1bccafa3568cc0cb9b3fdebf50b095cd24082475e71f6764950
Contents?: true
Size: 1021 Bytes
Versions: 27
Compression:
Stored size: 1021 Bytes
Contents
/** * @namespace WORKAREA.selects */ WORKAREA.registerModule('selects', (function () { 'use strict'; /** * @method * @name init * @memberof WORKAREA.selects */ var getConfig = function (select) { var config = _.assign({}, $(select).data('select')); if ( ! _.isUndefined(config.dropdownParent)) { config.dropdownParent = $(config.dropdownParent); } return config; }, setup = function(index, select) { var config = getConfig(select), $select = $(select); if (config.allowClear) { $select.before(JST['workarea/core/templates/hidden_input']({ name: $select.attr('name'), value: '' })); } $select.select2(config); }, init = function ($scope) { $('[data-select]', $scope).each(setup); }; return { init: init }; }()));
Version data entries
27 entries across 27 versions & 1 rubygems