mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Fixed javascript conflicts, fixing select2 and icheck
This commit is contained in:
parent
55d0f8c0df
commit
ff2c489af4
24
gulpfile.js
24
gulpfile.js
|
@ -2,7 +2,7 @@ var elixir = require('laravel-elixir');
|
|||
require('laravel-elixir-codeception-standalone');
|
||||
require('laravel-elixir-phpcs');
|
||||
require('laravel-elixir-vue-2');
|
||||
var bowerPath = './vendor/bower_components';
|
||||
var bowerPath = './bower_components';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -42,18 +42,18 @@ elixir(function(mix) {
|
|||
|
||||
|
||||
mix.scripts([
|
||||
bowerPath + '/tether/dist/js/tether.js',
|
||||
'vue-dist.js',
|
||||
bowerPath + '/jquery-ui/**',
|
||||
bowerPath + '/bootstrap/dist/js/**',
|
||||
bowerPath + '/jquery-slimscroll/**',
|
||||
bowerPath + '/jquery.iframe-transport/**',
|
||||
bowerPath + '/fileupload/**',
|
||||
bowerPath + '/fastclick/**',
|
||||
bowerPath + '/bootstrap-colorpicker/**',
|
||||
bowerPath + '/bootstrap-datepicker/**',
|
||||
bowerPath + '/iCheck/**',
|
||||
bowerPath + '/select2/dist/js/select2.full.*',
|
||||
bowerPath + '/ekko-lightbox/**',
|
||||
bowerPath + '/jquery-ui/jquery-ui.js',
|
||||
bowerPath + '/jquery-slimscroll/jquery.slimscroll.js',
|
||||
bowerPath + '/jquery.iframe-transport/jquery.iframe-transport.js',
|
||||
bowerPath + '/blueimp-file-upload/js/jquery.fileupload.js',
|
||||
bowerPath + '/fastclick/lib/fastclick.js',
|
||||
bowerPath + '/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js',
|
||||
bowerPath + '/bootstrap-datepicker/dist/js/bootstrap-datepicker.js',
|
||||
bowerPath + '/iCheck/icheck.js',
|
||||
bowerPath + '/select2/dist/js/select2.full.js',
|
||||
bowerPath + '/ekko-lightbox/dist/ekko-lightbox.js',
|
||||
'snipeit.js'
|
||||
|
||||
],'public/assets/js');
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
18
public/build/assets/css/app-20fdbc86e7.css
Normal file
18
public/build/assets/css/app-20fdbc86e7.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
25
public/build/assets/js/all-b5250d9fda.js
Normal file
25
public/build/assets/js/all-b5250d9fda.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"assets/css/app.css": "assets/css/app-393b8564f1.css",
|
||||
"assets/js/all.js": "assets/js/all-7d26b7470b.js"
|
||||
"assets/css/app.css": "assets/css/app-20fdbc86e7.css",
|
||||
"assets/js/all.js": "assets/js/all-b5250d9fda.js"
|
||||
}
|
|
@ -692,60 +692,6 @@ function _init() {
|
|||
|
||||
})(jQuery);
|
||||
|
||||
/*
|
||||
* TODO LIST CUSTOM PLUGIN
|
||||
* -----------------------
|
||||
* This plugin depends on iCheck plugin for checkbox and radio inputs
|
||||
*
|
||||
* @type plugin
|
||||
* @usage $("#todo-widget").todolist( options );
|
||||
*/
|
||||
(function ($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
$.fn.todolist = function (options) {
|
||||
// Render options
|
||||
var settings = $.extend({
|
||||
//When the user checks the input
|
||||
onCheck: function (ele) {
|
||||
return ele;
|
||||
},
|
||||
//When the user unchecks the input
|
||||
onUncheck: function (ele) {
|
||||
return ele;
|
||||
}
|
||||
}, options);
|
||||
|
||||
return this.each(function () {
|
||||
|
||||
if (typeof $.fn.iCheck != 'undefined') {
|
||||
$('input', this).on('ifChecked', function () {
|
||||
var ele = $(this).parents("li").first();
|
||||
ele.toggleClass("done");
|
||||
settings.onCheck.call(ele);
|
||||
});
|
||||
|
||||
$('input', this).on('ifUnchecked', function () {
|
||||
var ele = $(this).parents("li").first();
|
||||
ele.toggleClass("done");
|
||||
settings.onUncheck.call(ele);
|
||||
});
|
||||
} else {
|
||||
$('input', this).on('change', function () {
|
||||
var ele = $(this).parents("li").first();
|
||||
ele.toggleClass("done");
|
||||
if ($('input', ele).is(":checked")) {
|
||||
settings.onCheck.call(ele);
|
||||
} else {
|
||||
settings.onUncheck.call(ele);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery));
|
||||
|
||||
|
||||
|
||||
const app = new Vue({
|
||||
|
|
|
@ -124,24 +124,24 @@ $(document).ready(function () {
|
|||
/*
|
||||
* iCheck checkbox plugin
|
||||
*/
|
||||
/*
|
||||
$('input[type="checkbox"].minimal, input[type="radio"].minimal').icheck({
|
||||
|
||||
$('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
|
||||
checkboxClass: 'icheckbox_minimal-blue',
|
||||
radioClass: 'iradio_minimal-blue'
|
||||
});
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Select2
|
||||
*/
|
||||
/*
|
||||
|
||||
var iOS = /iPhone|iPad|iPod/.test(navigator.userAgent) && !window.MSStream;
|
||||
if(!iOS)
|
||||
{
|
||||
$(".select2").select2();
|
||||
}
|
||||
$('.datepicker').datepicker();
|
||||
*/
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -226,7 +226,6 @@
|
|||
|
||||
$('.dynamic-form-row').hide();
|
||||
function show_er(selector) {
|
||||
//$(selector).show().parent().show();
|
||||
$(selector).parent().parent().show();
|
||||
}
|
||||
|
||||
|
@ -259,10 +258,8 @@
|
|||
|
||||
case 'supplier':
|
||||
|
||||
//do nothing, they just need 'name'
|
||||
}
|
||||
|
||||
//console.warn("The Model is: "+model+" and the select is: "+select);
|
||||
});
|
||||
|
||||
$("form").submit(function (event) {
|
||||
|
@ -401,28 +398,37 @@
|
|||
data[bits[1]] = $(elem).val();
|
||||
});
|
||||
|
||||
data._token = '{{ csrf_token() }}',
|
||||
//console.dir(data);
|
||||
data._token = '{{ csrf_token() }}';
|
||||
|
||||
$.post("{{url('/') }}/api/v1/" + model + "s", data, function (result) {
|
||||
var id = result.id;
|
||||
var name = result.name || (result.first_name + " " + result.last_name);
|
||||
$('.modal-body input:visible').val("");
|
||||
$('#createModal').modal('hide');
|
||||
|
||||
//console.warn("The select ID thing we're going for is: "+select);
|
||||
var selector = document.getElementById(select);
|
||||
selector.options[selector.length] = new Option(name, id);
|
||||
selector.selectedIndex = selector.length - 1;
|
||||
$(selector).trigger("change");
|
||||
fetchCustomFields();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: "{{ url('/') }}/api/v1/" + model + "s",
|
||||
headers: {
|
||||
"X-Requested-With": 'XMLHttpRequest',
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
|
||||
}).fail(function (result) {
|
||||
//console.dir(result.responseJSON);
|
||||
msg = result.responseJSON.error.message || result.responseJSON.error;
|
||||
window.alert("Unable to add new " + model + " - error: " + msg);
|
||||
});
|
||||
data: data,
|
||||
success: function (result) {
|
||||
|
||||
var id = result.id;
|
||||
var name = result.name || (result.first_name + " " + result.last_name);
|
||||
$('.modal-body input:visible').val("");
|
||||
$('#createModal').modal('hide');
|
||||
var selector = document.getElementById(select);
|
||||
selector.options[selector.length] = new Option(name, id);
|
||||
selector.selectedIndex = selector.length - 1;
|
||||
$(selector).trigger("change");
|
||||
fetchCustomFields();
|
||||
|
||||
},
|
||||
error: function (result) {
|
||||
msg = result.responseJSON.error.message || result.responseJSON.error;
|
||||
window.alert("Unable to add new " + model + " - error: " + msg);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue