add bootstrap file input and menu item img implemented
This commit is contained in:
@@ -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');
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
12
app/assets/javascripts/fileinput.min.js
vendored
Executable file
12
app/assets/javascripts/fileinput.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
12
app/assets/stylesheets/fileinput.min.css
vendored
Executable file
12
app/assets/stylesheets/fileinput.min.css
vendored
Executable file
File diff suppressed because one or more lines are too long
@@ -51,4 +51,9 @@ ul.dropdown-menu li a{
|
||||
font-weight:bold;
|
||||
font-style:italic;
|
||||
margin-bottom:0px;
|
||||
}
|
||||
|
||||
.menu-item-img {
|
||||
margin: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
Reference in New Issue
Block a user