From d407221be6ec07b8323935370fe07b5ff4dc9d80 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 31 Jan 2018 14:06:23 -0300 Subject: [PATCH] Bug 20115: Trigger "modified" when sort is changed Signed-off-by: Jesse Maseto Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart --- .../intranet-tmpl/prog/en/modules/admin/preferences.tt | 1 - koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt index ef4cd66b2a..4bff6d47d0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt @@ -162,7 +162,6 @@ });[% END %] $(document).ready(function(){ - $("dl.sortable").sortable(); $("select[multiple='multiple']").multipleSelect( { placeholder: _("Please select ..."), selectAllText: _("Select all"), diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js index 70365cd8b0..f7ed5e1121 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js +++ b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js @@ -82,6 +82,12 @@ $( document ).ready( function () { return false; }); + $("dl.sortable").sortable(); + $("dl.sortable").on( "sortchange", function( event, ui ) { + // This is not exact but we just need to trigger a change + $(ui.item.find('input:first')).change(); + } ); + window.onbeforeunload = function () { if ( KOHA.Preferences.Modified ) { return MSG_MADE_CHANGES; -- 2.39.5