From c1fbd6953d1b2ed4aad23579b4e66a6abef5b272 Mon Sep 17 00:00:00 2001 From: slace Date: Mon, 3 May 2010 01:36:31 +0000 Subject: [PATCH] fixing custom drop downs for doc type icons [TFS Changeset #65919] --- .../controls/ContentTypeControlNew.ascx | 4 +- .../controls/ContentTypeControlNew.ascx.cs | 46 ++----------------- .../umbraco_client/ui/jquery.dd.js | 2 +- 3 files changed, 8 insertions(+), 44 deletions(-) diff --git a/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx b/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx index 1b5f3a5d87..dc641bb888 100644 --- a/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx +++ b/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx @@ -59,10 +59,10 @@ - + - + diff --git a/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx.cs b/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx.cs index 572d651b5e..453ad1fbbe 100644 --- a/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx.cs +++ b/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx.cs @@ -8,16 +8,16 @@ using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using ClientDependency.Core; +using umbraco.cms.helpers; using umbraco.IO; using umbraco.presentation; -using umbraco.cms.helpers; namespace umbraco.controls { [ClientDependency(ClientDependencyType.Javascript, "ui/jqueryui.js", "UmbracoClient")] - //[ClientDependency(ClientDependencyType.Javascript, "ui/jquery.dd.js", "UmbracoClient")] - //[ClientDependency(ClientDependencyType.Css, "ui/dd.css", "UmbracoClient")] + [ClientDependency(ClientDependencyType.Javascript, "ui/jquery.dd.js", "UmbracoClient")] + [ClientDependency(ClientDependencyType.Css, "ui/dd.css", "UmbracoClient")] [ClientDependency(ClientDependencyType.Css, "Tree/treeIcons.css", "UmbracoClient")] [ClientDependency(ClientDependencyType.Css, "Tree/Themes/umbraco/style.css", "UmbracoClient")] public partial class ContentTypeControlNew : System.Web.UI.UserControl @@ -156,7 +156,7 @@ namespace umbraco.controls ddlIcons.Items.AddRange(listOfIcons.OrderBy(o => o.Text).ToArray()); - //Page.ClientScript.RegisterStartupScript(this.GetType(), "iconsDropDown", "jQuery(function() { jQuery('#" + ddlIcons.ClientID + "').msDropDown({ showIcon: false }); });", true); + Page.ClientScript.RegisterStartupScript(this.GetType(), "iconsDropDown", "jQuery(function() { jQuery('#" + ddlIcons.ClientID + "').msDropDown({ showIcon: true, style: 'width:250px;' }); });", true); // Get thumbnails dirInfo = new DirectoryInfo(IOHelper.MapPath(SystemDirectories.Umbraco + "/images/thumbnails")); @@ -169,7 +169,7 @@ namespace umbraco.controls ddlThumbnails.Items.Add(li); } - //Page.ClientScript.RegisterStartupScript(this.GetType(), "thumbnailsDropDown", "jQuery(function() { jQuery('#" + ddlThumbnails.ClientID + "').msDropDown({ showIcon: false, rowHeight: '130', visibleRows: '2' }); });", true); + Page.ClientScript.RegisterStartupScript(this.GetType(), "thumbnailsDropDown", "jQuery(function() { jQuery('#" + ddlThumbnails.ClientID + "').msDropDown({ showIcon: false, rowHeight: '130', visibleRows: '2', style: 'width:250px;' }); });", true); txtName.Text = cType.GetRawText(); txtAlias.Text = cType.Alias; @@ -210,7 +210,6 @@ namespace umbraco.controls } dualAllowedContentTypes.Value = chosenContentTypeIDs; } - // PlaceHolderAllowedContentTypes.Controls.Add(dualAllowedContentTypes); } private void SaveAllowedChildTypes() @@ -584,41 +583,6 @@ namespace umbraco.controls } } } - - - - - /* - - foreach (DataListItem dli in dlTabs.Items) - { - DataGrid dg = (DataGrid)dli.FindControl("dgGenericPropertiesOfTab"); - foreach (DataGridItem dgi in dg.Items) - { - - int propertyTypeId = int.Parse(dgi.Cells[0].Text); - cms.businesslogic.propertytype.PropertyType editPropertyType = new cms.businesslogic.propertytype.PropertyType(propertyTypeId); - string tbName = ((TextBox) dgi.FindControl("txtPName")).Text.Replace("'","''"); - string tbAlias = ((TextBox) dgi.FindControl("txtPAlias")).Text.Replace("'","''"); - int TypeId = int.Parse(((DropDownList) dgi.FindControl("ddlType")).SelectedValue); - int TabId = int.Parse(((DropDownList) dgi.FindControl("dllTab")).SelectedValue); - - if (TypeId != editPropertyType.DataTypeDefinition.Id) - editPropertyType.DataTypeDefinition = new cms.businesslogic.datatype.DataTypeDefinition(TypeId); - - if (tbName != editPropertyType.Name) - editPropertyType.Name = tbName; - - if (tbAlias != editPropertyType.Alias) - editPropertyType.Alias = tbAlias; - if (TabId == 0) - cType.removePropertyTypeFromTab(editPropertyType); - else - cType.SetTabOnPropertyType(editPropertyType,TabId); - } - - } - */ } public bool HasRows(System.Data.DataView dv) diff --git a/umbraco/presentation/umbraco_client/ui/jquery.dd.js b/umbraco/presentation/umbraco_client/ui/jquery.dd.js index ba2e0fba40..a7122b0174 100644 --- a/umbraco/presentation/umbraco_client/ui/jquery.dd.js +++ b/umbraco/presentation/umbraco_client/ui/jquery.dd.js @@ -160,7 +160,7 @@ var titletextid = getPostID("postTitleTextID"); var childid = getPostID("postChildID"); var arrowid = getPostID("postArrowID"); - var iWidth = $("#" + elementid).css('width'); //had to change this from .width() + var iWidth = $("#" + elementid).width(); var sStyle = options.style; if ($("#" + id).length > 0) { $("#" + id).remove();