From d6a749995fbe0aa94756da3e6d6da8bb0bd4d587 Mon Sep 17 00:00:00 2001 From: BoHung Chiu Date: Sat, 18 Mar 2023 17:28:01 +0800 Subject: [PATCH] Fix bug. --- .../fields_setting.html.erb | 42 +++++++++---------- .../index_search1.html.erb | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/views/admin/personal_plugin_fields/fields_setting.html.erb b/app/views/admin/personal_plugin_fields/fields_setting.html.erb index eed0b36..894e630 100644 --- a/app/views/admin/personal_plugin_fields/fields_setting.html.erb +++ b/app/views/admin/personal_plugin_fields/fields_setting.html.erb @@ -88,27 +88,6 @@ $('#backend_fields_analysis').css( 'border',''); } }) - $( ".table tbody td" ).each(function(i,v){ - $(v).attr("index",$(v).index()); - $(v).html("" + $(v).html()); - }) - $( ".table tbody >" ).sortable({ - axis: "x", - revert: true, - handle: ".brand", - update: function(event, ui) { - var new_index = ui.item.index(); - var old_index = ui.item.attr("index"); - var indices = [new_index,old_index].sort(); - for(var new_i=indices[0];new_i<=indices[1];new_i++){ - var td = ui.item.parent().find(">").eq(new_i); - var old_i =td.attr("index"); - var org_i = td.data("index"); - td.attr("index",new_i); - td.find('.fields_order_hidden_input').val(new_i); - } - } - }); $( ".sort_asc_fields, .sort_desc_fields" ).on("click", function(){ var _this = $(this); if(_this.prop('checked')){ @@ -117,4 +96,25 @@ } }) } + $( ".table tbody td" ).each(function(i,v){ + $(v).attr("index",$(v).index()); + $(v).html("" + $(v).html()); + }) + $( ".table tbody >" ).sortable({ + axis: "x", + revert: true, + handle: ".brand", + update: function(event, ui) { + var new_index = ui.item.index(); + var old_index = ui.item.attr("index"); + var indices = [new_index,old_index].sort(); + for(var new_i=indices[0];new_i<=indices[1];new_i++){ + var td = ui.item.parent().find(">").eq(new_i); + var old_i =td.attr("index"); + var org_i = td.data("index"); + td.attr("index",new_i); + td.find('.fields_order_hidden_input').val(new_i); + } + } + }); \ No newline at end of file diff --git a/template_generator/modules/personal_plugin_template/index_search1.html.erb b/template_generator/modules/personal_plugin_template/index_search1.html.erb index e820df4..1509014 100644 --- a/template_generator/modules/personal_plugin_template/index_search1.html.erb +++ b/template_generator/modules/personal_plugin_template/index_search1.html.erb @@ -24,7 +24,7 @@ $( ".selectbox" ).ready(function() { - +

{{widget-title}}

{{widget-title}}

{{head-title}}