You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.2 KiB
56 lines
1.2 KiB
/* ------------------------------------------------------------------------------ |
|
* |
|
* # Form layouts |
|
* |
|
* Specific JS code additions for form layouts pages |
|
* |
|
* Version: 1.0 |
|
* Latest update: Aug 1, 2015 |
|
* |
|
* ---------------------------------------------------------------------------- */ |
|
|
|
$(function() { |
|
|
|
|
|
// Select2 select |
|
// ------------------------------ |
|
|
|
// Basic |
|
$('.select').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 |
|
$(".select-icons").select2({ |
|
templateResult: iconFormat, |
|
minimumResultsForSearch: Infinity, |
|
templateSelection: iconFormat, |
|
escapeMarkup: function(m) { return m; } |
|
}); |
|
|
|
|
|
|
|
// Styled form components |
|
// ------------------------------ |
|
|
|
// Checkboxes, radios |
|
$(".styled").uniform({ radioClass: 'choice' }); |
|
|
|
// File input |
|
$(".file-styled").uniform({ |
|
fileButtonClass: 'action btn bg-pink-400' |
|
}); |
|
|
|
});
|
|
|