芝麻web文件管理V1.00
编辑当前文件:/home/krishnamexports/www/panel/global_assets/js/demo_pages/form_layouts.js
/* ------------------------------------------------------------------------------ * * # Form layouts * * Demo JS code for form layouts pages * * ---------------------------------------------------------------------------- */ // Setup module // ------------------------------ var FormLayouts = function() { // // Setup module components // // Select2 var _componentSelect2 = function() { if (!$().select2) { console.warn('Warning - select2.min.js is not loaded.'); return; }; // Basic example $('.form-control-select2').select2(); // // Select with icons // // Format icon function iconFormat(icon) { var originalOption = icon.element; if (!icon.id) { return icon.text; } var $icon = "
" + icon.text; return $icon; } // Initialize with options $('.form-control-select2-icons').select2({ templateResult: iconFormat, minimumResultsForSearch: Infinity, templateSelection: iconFormat, escapeMarkup: function(m) { return m; } }); }; // Uniform var _componentUniform = function() { if (!$().uniform) { console.warn('Warning - uniform.min.js is not loaded.'); return; } // Initialize $('.form-input-styled').uniform({ fileButtonClass: 'action btn bg-pink-400' }); }; // // Return objects assigned to module // return { init: function() { _componentSelect2(); _componentUniform(); } } }(); // Initialize module // ------------------------------ document.addEventListener('DOMContentLoaded', function() { FormLayouts.init(); });