mirror of
https://gitee.com/coder-xiaomo/flashsale
synced 2025-09-13 15:31:38 +08:00
添加Metronic(作为LFS)
This commit is contained in:
49
frontend/static/assets/admin/pages/scripts/form-samples.js
Normal file
49
frontend/static/assets/admin/pages/scripts/form-samples.js
Normal file
@@ -0,0 +1,49 @@
|
||||
var FormSamples = function () {
|
||||
|
||||
|
||||
return {
|
||||
//main function to initiate the module
|
||||
init: function () {
|
||||
|
||||
// use select2 dropdown instead of chosen as select2 works fine with bootstrap on responsive layouts.
|
||||
$('.select2_category').select2({
|
||||
placeholder: "Select an option",
|
||||
allowClear: true
|
||||
});
|
||||
|
||||
$('.select2_sample1').select2({
|
||||
placeholder: "Select a State",
|
||||
allowClear: true
|
||||
});
|
||||
|
||||
$(".select2_sample2").select2({
|
||||
placeholder: "Type to select an option",
|
||||
allowClear: true,
|
||||
minimumInputLength: 1,
|
||||
query: function (query) {
|
||||
var data = {
|
||||
results: []
|
||||
}, i, j, s;
|
||||
for (i = 1; i < 5; i++) {
|
||||
s = "";
|
||||
for (j = 0; j < i; j++) {
|
||||
s = s + query.term;
|
||||
}
|
||||
data.results.push({
|
||||
id: query.term + i,
|
||||
text: s
|
||||
});
|
||||
}
|
||||
query.callback(data);
|
||||
}
|
||||
});
|
||||
|
||||
$(".select2_sample3").select2({
|
||||
tags: ["red", "green", "blue", "yellow", "pink"]
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}();
|
Reference in New Issue
Block a user