From 5ca7695494424c7600e41a5d17d11dae7d2dcb56 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Mon, 24 Apr 2023 23:29:08 +0200 Subject: [PATCH] fix js warning --- js/backend.js | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/js/backend.js b/js/backend.js index 3634d53..9d35628 100644 --- a/js/backend.js +++ b/js/backend.js @@ -1,25 +1,17 @@ -/* -- BEGIN LICENSE BLOCK ---------------------------------- - * - * This file is part of postExpired, a plugin for Dotclear 2. - * - * Copyright (c) 2009-2013 Jean-Christian Denis and contributors - * contact@jcdenis.fr http://jcd.lv - * - * Licensed under the GPL version 2.0 license. - * A copy of this license is available in LICENSE file or at - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * - * -- END LICENSE BLOCK ------------------------------------*/ +/*global $, dotclear, datePicker */ +'use strict'; -$(function(){ +$(() => { + if (typeof datePicker === 'function') { var post_pe_field=document.getElementById('post_expired_date'); if(post_pe_field!=undefined){ var post_pe_dtPick=new datePicker(post_pe_field); post_pe_dtPick.img_top='1.5em'; post_pe_dtPick.draw(); } - $('#post_expired h4').toggleWithLegend( - $('#post_expired').children().not('h4'), - {cookie:'dcx_postexpired_admin_form_sidebar',legend_click:true} - ); + } + $('#post_expired h4').toggleWithLegend( + $('#post_expired').children().not('h4'), + {cookie:'dcx_postexpired_admin_form_sidebar',legend_click:true} + ); }); \ No newline at end of file