Fixes performance issue with document type icon dropdown (no more limits on number of icons - yuppiieeee). Work items: 30747

This commit is contained in:
hartvig
2012-07-12 10:27:22 -02:00
parent 577ad79a7f
commit 4317c7f2c4
3 changed files with 1078 additions and 435 deletions

View File

@@ -203,7 +203,7 @@ namespace umbraco.controls
// NH: don't show the sprite file
if (fileInfo[i].Name != "sprites.png" && fileInfo[i].Name != "sprites_ie6.gif")
{
ListItem li = new ListItem(fileInfo[i].Name + " (deprecated)", fileInfo[i].Name);
ListItem li = new ListItem(fileInfo[i].Name, fileInfo[i].Name);
li.Attributes.Add("title", this.ResolveClientUrl(SystemDirectories.Umbraco + "/images/umbraco/" + fileInfo[i].Name));
if (li.Value == cType.IconUrl)
@@ -225,17 +225,13 @@ namespace umbraco.controls
ddlThumbnails.Items.Add(li);
}
Page.ClientScript.RegisterStartupScript(this.GetType(), "thumbnailsDropDown", @"
function refreshDropDowns() {
if (jQuery('#" + ddlIcons.ClientID + @" option').length <= 100)
jQuery('#" + ddlIcons.ClientID + @"').msDropDown({ showIcon: true, style: 'width:250px;' });
else {
jQuery('#" + ddlIcons.ClientID + @"').before('<div class=\'notice\'><p>For performance reasons, icons will not be displayed when there are more than 100 items in the dropdown.</p></div');
}
jQuery('#" + ddlThumbnails.ClientID + @"').msDropDown({ showIcon: false, rowHeight: '130', visibleRows: '2', style: 'width:250px;' });
}
jQuery(function() { refreshDropDowns(); });
", true);
Page.ClientScript.RegisterStartupScript(this.GetType(), "thumbnailsDropDown", string.Format(@"
function refreshDropDowns() {{
jQuery('#{1}').msDropDown({{ showIcon: true, style: 'width:250px;' }});
jQuery('#{3}').msDropDown({{ showIcon: false, rowHeight: '130', visibleRows: '2', style: 'width:250px;' }});
}}
jQuery(document).ready(function() {{ refreshDropDowns(); }});
", ddlIcons.ClientID, ddlIcons.ClientID, ddlIcons.ClientID, ddlThumbnails.ClientID, 500), true);
txtName.Text = cType.GetRawText();
txtAlias.Text = cType.Alias;
description.Text = cType.GetRawDescription();

View File

@@ -1,63 +1,172 @@
.dd {
/*display:inline-block !important;*/
text-align:left;
background-color:#fff;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
float:left;
}
.dd .ddTitle {
background:#f2f2f2;
border:1px solid #c3c3c3;
padding:3px;
text-indent:0;
cursor:default;
overflow:hidden;
height:16px;
}
.dd .ddTitle span.arrow {
background:url(dd_arrow.gif) no-repeat 0 0; float:right; display:inline-block;width:16px; height:16px; cursor:pointer;
}
.dd .ddTitle span.textTitle {text-indent:1px; overflow:hidden; line-height:16px;}
.dd .ddTitle span.textTitle img{text-align:left; padding:0 2px 0 0}
.dd .ddTitle img.selected {
padding:0 3px 0 0;
vertical-align:top;
}
.dd .ddChild {
position:absolute;
border:1px solid #c3c3c3;
border-top:none;
display:none;
margin:0;
width:auto;
overflow:auto;
overflow-x:hidden !important;
background-color:#ffffff;
}
.dd .ddChild .opta a, .dd .ddChild .opta a:visited {padding-left:10px}
.dd .ddChild a {
display:block;
padding:3px 0 3px 3px;
text-decoration:none;
color:#000;
overflow:hidden;
white-space:nowrap;
cursor:pointer;
}
.dd .ddChild a:hover {
background-color:#66CCFF;
}
.dd .ddChild a img {
border:0;
padding:0 2px 0 0;
vertical-align:middle;
max-height: 80px;
max-width: 80px;
}
.dd .ddChild a.selected {
background:#66CCFF;
}
.hidden {display:none;}
/************** Skin 1 *********************/
.dd {
/*display:inline-block !important;*/
text-align:left;
background-color:#fff;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
position:relative;
}
.dd .ddTitle {
background:#f2f2f2;
border:1px solid #c3c3c3;
padding:3px;
text-indent:0;
cursor:default;
overflow:hidden;
height:16px;
}
.dd .ddTitle span.arrow {
background:url(dd_arrow.gif) no-repeat 0 0; float:right; display:inline-block;width:16px; height:16px; cursor:pointer;
}
.dd .ddTitle span.ddTitleText {text-indent:1px; overflow:hidden; line-height:16px;}
.dd .ddTitle span.ddTitleText img{text-align:left; padding:0 2px 0 0}
.dd .ddTitle img.selected {
padding:0 3px 0 0;
vertical-align:top;
}
.dd .ddChild {
position:absolute;
border:1px solid #c3c3c3;
border-top:none;
display:none;
margin:0;
width:auto;
overflow:auto;
overflow-x:hidden !important;
background-color:#ffffff;
}
.dd .ddChild .opta a, .dd .ddChild .opta a:visited {padding-left:10px}
.dd .ddChild a {
display:block;
padding:2px 0 2px 3px;
text-decoration:none;
color:#000;
overflow:hidden;
white-space:nowrap;
cursor:pointer;
}
.dd .ddChild a:hover {
background-color:#66CCFF;
}
.dd .ddChild a img {
border:0;
padding:0 2px 0 0;
vertical-align:middle;
}
.dd .ddChild a.selected {
background-color:#66CCFF;
}
.hidden {display:none;}
.dd .borderTop{border-top:1px solid #c3c3c3 !important;}
.dd .noBorderTop{border-top:none 0 !important}
/************** Skin 2 *********************/
.dd2 {
/*display:inline-block !important;*/
text-align:left;
background-color:#fff;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
position:relative;
}
.dd2 .ddTitle {
background:transparent url(../images/msDropDown.gif) no-repeat;
padding:0 3px;
text-indent:0;
cursor:default;
overflow:hidden;
height:36px;
}
.dd2 .ddTitle span.arrow {
background:transparent url(../images/icon-arrow.gif) no-repeat 0 0; float:right; display:inline-block;width:27px; height:27px; cursor:pointer; top:5px; position:relative; right:2px;
}
.dd2 .ddTitle span.ddTitleText {text-indent:1px; overflow:hidden; line-height:33px; font-family:Georgia, "Times New Roman", Times, serif; font-size:16px; font-weight:bold; color:#fff;}
.dd2 .ddTitle span.ddTitleText img{text-align:left; padding:0 2px 0 0;}
.dd2 .ddTitle img.selected {
padding:0 2px 0 0;
vertical-align:top;
}
.dd2 .ddChild {
position:absolute;
border:1px solid #c3c3c3;
border-top:none;
display:none;
margin:0;
width:auto;
overflow:auto;
overflow-x:hidden !important;
background-color:#ffffff;
font-size:14px;
}
.dd2 .ddChild .opta a, .dd2 .ddChild .opta a:visited {padding-left:10px}
.dd2 .ddChild a {
display:block;
padding:3px 0 3px 3px;
text-decoration:none;
color:#000;
overflow:hidden;
white-space:nowrap;
cursor:pointer;
}
.dd2 .ddChild a:hover {
background-color:#66CCFF;
}
.dd2 .ddChild a img {
border:0;
padding:0 2px 0 0;
vertical-align:middle;
}
.dd2 .ddChild a.selected {
background-color:#66CCFF;
}
.dd2 .borderTop{border-top:1px solid #c3c3c3 !important;}
.dd2 .noBorderTop{border-top:none 0 !important}
/************* use sprite *****************/
.dd .ddChild a.sprite, .dd .ddChild a.sprite:visited {
background-image:url(../icons/sprite.gif);
background-repeat:no-repeat;
padding-left:24px;
}
.dd .ddChild a.calendar, .dd .ddChild a.calendar:visited {
background-position:0 -404px;
}
.dd .ddChild a.shoppingcart, .dd .ddChild a.shoppingcart:visited {
background-position:0 -330px;
}
.dd .ddChild a.cd, .dd .ddChild a.cd:visited {
background-position:0 -439px;
}
.dd .ddChild a.email, .dd .ddChild a.email:visited {
background-position:0 -256px;
}
.dd .ddChild a.faq, .dd .ddChild a.faq:visited {
background-position:0 -183px;
}
.dd .ddChild a.games,
.dd .ddChild a.games:visited {
background-position:0 -365px;
}
.dd .ddChild a.music, .dd .ddChild a.music:visited {
background-position:0 -146px;
}
.dd .ddChild a.phone, .dd .ddChild a.phone:visited {
background-position:0 -109px;
}
.dd .ddChild a.graph, .dd .ddChild a.graph:visited {
background-position:0 -73px;
}
.dd .ddChild a.secured, .dd .ddChild a.secured:visited {
background-position:0 -37px;
}
.dd .ddChild a.video, .dd .ddChild a.video:visited {
background-position:0 0;
}
/*******************************/

File diff suppressed because it is too large Load Diff