mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
Fix deprecation warnings from jquery
This commit is contained in:
parent
73de93a561
commit
d5dd7297b5
@ -12,28 +12,29 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
$(".sortable").sortable();
|
const $sortable = $(".sortable");
|
||||||
$(".sortable").disableSelection();
|
$sortable.sortable();
|
||||||
|
$sortable.disableSelection();
|
||||||
|
|
||||||
$(".remove-button").click(function () {
|
$(".remove-button").on('click', function () {
|
||||||
var id = $(this).attr("id");
|
var id = $(this).attr("id");
|
||||||
$('#list-' + id.replace('remove-button-', '')).remove();
|
$('#list-' + id.replace('remove-button-', '')).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".add-button").click(function () {
|
$(".add-button").on('click', function () {
|
||||||
var cat = $(this).attr("id").replace('add-button-', '');
|
var cat = $(this).attr("id").replace('add-button-', '');
|
||||||
var id = last_id[cat];
|
var id = last_id[cat];
|
||||||
last_id[cat]++;
|
last_id[cat]++;
|
||||||
const color = colors[cat];
|
const color = colors[cat];
|
||||||
$('#sortable-' + cat).append('<li class="ui-state-default" id="list-' + cat + '-' + id + '"><label>Name:</label> <input type="text" name="menu[' + cat + '][]" value=""/> <label>Link:</label> <input type="text" name="menu_link[' + cat + '][]" value=""/><input type="hidden" name="menu_blank[' + cat + '][]" value="0" /> <label><input class="blank-checkbox" type="checkbox"/><span title="Open in New Window">New Window</span></label> <input class="color-picker" type="text" name="menu_color[' + cat + '][]" value="#' + color + '" /><a class="remove-button" id="remove-button-' + cat + '-' + id + '"><i class="fas fa-trash"></i></a></li>'); //add input bo
|
$('#sortable-' + cat).append('<li class="ui-state-default" id="list-' + cat + '-' + id + '"><label>Name:</label> <input type="text" name="menu[' + cat + '][]" value=""/> <label>Link:</label> <input type="text" name="menu_link[' + cat + '][]" value=""/><input type="hidden" name="menu_blank[' + cat + '][]" value="0" /> <label><input class="blank-checkbox" type="checkbox"/><span title="Open in New Window">New Window</span></label> <input class="color-picker" type="text" name="menu_color[' + cat + '][]" value="#' + color + '" /> <a class="remove-button" id="remove-button-' + cat + '-' + id + '"><i class="fas fa-trash"></i></a></li>'); //add input bo
|
||||||
$('#remove-button-' + cat + '-' + id).click(function () {
|
$('#remove-button-' + cat + '-' + id).on('click', function () {
|
||||||
$('#list-' + $(this).attr("id").replace('remove-button-', '')).remove();
|
$('#list-' + $(this).attr("id").replace('remove-button-', '')).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
initialiceSpectrum();
|
initializeSpectrum();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#menus-form").submit(function (e) {
|
$("#menus-form").on('submit', function (e) {
|
||||||
$('.blank-checkbox:not(:checked)').each(function (i, obj) {
|
$('.blank-checkbox:not(:checked)').each(function (i, obj) {
|
||||||
$(obj).parent().prev().val("off");
|
$(obj).parent().prev().val("off");
|
||||||
});
|
});
|
||||||
@ -60,11 +61,11 @@
|
|||||||
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/js/spectrum.js"></script>
|
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/js/spectrum.js"></script>
|
||||||
<link type="text/css" rel="stylesheet" href="{{ constant('BASE_URL') }}tools/css/spectrum.css"/>
|
<link type="text/css" rel="stylesheet" href="{{ constant('BASE_URL') }}tools/css/spectrum.css"/>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(function () {
|
||||||
initialiceSpectrum();
|
initializeSpectrum();
|
||||||
});
|
});
|
||||||
|
|
||||||
function initialiceSpectrum() {
|
function initializeSpectrum() {
|
||||||
$(".color-picker").spectrum({
|
$(".color-picker").spectrum({
|
||||||
preferredFormat: "hex",
|
preferredFormat: "hex",
|
||||||
showInput: true,
|
showInput: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user