From 9ced66f2080bb29c112e5ecfcc28b88f0b17987b Mon Sep 17 00:00:00 2001 From: bjarnef Date: Mon, 19 Jan 2015 21:49:27 +0100 Subject: [PATCH] U4-4418 - fix issue with tab sorting Fixed issue with tab sorting, where you are able to drag the rows above the table header. Ensured that / is added, so the class "ui-sortable" is added to and only will be the drag-area. I also added styling for delete button so it's more consistent with other "delete"-buttons, e.g. for in settings for dropdown lists, checkbox lists and radionbutton lists. Furthermore the delete-button is moved inside the ItemTemplate, so the classes easily could be added to the button and also make the button stay close to the fields. --- .../umbraco/controls/ContentTypeControlNew.ascx | 6 +++--- .../controls/ContentTypeControlNew.ascx.cs | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx b/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx index f59534258d..5e14be9ed9 100644 --- a/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx +++ b/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx @@ -25,18 +25,18 @@ - + + -

diff --git a/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx.cs b/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx.cs index 096bb5b724..39f04b0688 100644 --- a/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx.cs +++ b/src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx.cs @@ -28,6 +28,21 @@ namespace Umbraco.Web.UI.Umbraco.Controls DataTypeControllerUrl = Url.GetUmbracoApiServiceBaseUrl(x => x.GetById(0)); ContentTypeControllerUrl = Url.GetUmbracoApiServiceBaseUrl(x => x.GetAssignedListViewDataType(0)); } + + protected void dgTabs_PreRender(object sender, EventArgs e) + { + dgTabs.UseAccessibleHeader = true; //to make sure we render th, not td + + Table table = dgTabs.Controls[0] as Table; + if (table != null && table.Rows.Count > 0) + { + // here we render and + if (dgTabs.ShowHeader) + table.Rows[0].TableSection = TableRowSection.TableHeader; + if (dgTabs.ShowFooter) + table.Rows[table.Rows.Count - 1].TableSection = TableRowSection.TableFooter; + } + } } } \ No newline at end of file