add bootstrap file input and menu item img implemented

This commit is contained in:
Yan
2017-08-15 16:27:40 +06:30
parent 3bfc7f0f53
commit e69eeadb6e
13 changed files with 111 additions and 22 deletions

View File

@@ -20,25 +20,47 @@
//= require jquery-ui
//= require bootstrap-datepicker
$(document).on("focus", "[data-behaviour~='datepicker']", function(e){
$(document).on('turbolinks:load', function() {
$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
autoclose: true
});
$('.datepicker').attr('ReadOnly','true');
$('.datepicker').css('cursor','pointer');
// Image Upload
$("#simple_menu_item_image_path").fileinput({
previewFileType: "image",
allowedFileExtensions: ["jpg", "gif", "png"],
browseClass: "btn btn-success",
browseLabel: "Pick Image",
browseIcon: "<i class=\"fa fa-image\"></i> ",
removeClass: "btn btn-danger",
removeLabel: "Delete",
removeIcon: "<i class=\"fa fa-trash\"></i> ",
showUpload: false,
// uploadClass: "btn btn-info",
// uploadLabel: "Upload",
// uploadIcon: "<i class=\"fa fa-upload\"></i> ",
previewTemplates: {
image: '<div class="file-preview-frame" id="{previewId}" data-fileindex="{fileindex}">\n' +
' <img src="{data}" class="file-preview-image" title="{caption}" alt="{caption}" style="width: 200px;height: 200px;">\n' +
'</div>\n',
}
});
});
$(document).on("focus", "[data-behaviour~='datepicker']", function(e){
$(this).datepicker({"format": "yyyy-M-dd", "weekStart": 1, "autoclose": true});
$('.dropdown-toggle').dropdown();
$('.dropdown-toggle').dropdown();
});
function export_to(path)
{
var form_params = $("#frm_report").serialize();
window.location = path+"?"+ form_params;
var form_params = $("#frm_report").serialize();
window.location = path+"?"+ form_params;
}
$(function () {
$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
autoclose: true
});
$('.datepicker').attr('ReadOnly','true');
$('.datepicker').css('cursor','pointer');
});