| Server IP : 50.63.8.194 / Your IP : 216.73.216.202 Web Server : Microsoft-IIS/10.0 System : Windows NT P3NWVPWEB026 10.0 build 17763 (Windows Server 2016) AMD64 User : IWPD_7824(SpiPanel) ( 0) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : G:/PleskVhosts/polyprep.in/mmitshamli.ac.in/admin/global_assets/js/demo_pages/ |
Upload File : |
/* ------------------------------------------------------------------------------
*
* # 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 = "<i class='icon-" + $(icon.element).data('icon') + "'></i>" + 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();
});