mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#18740: Preventing link collision on "current" class
Work Item: 18740 --HG-- branch : 1.x
This commit is contained in:
@@ -8,7 +8,7 @@ if (!HasText(Model.Text)) {
|
|||||||
} else {
|
} else {
|
||||||
string requestUrl = Request.Path.Replace(Request.ApplicationPath, string.Empty).TrimEnd('/').ToUpperInvariant();
|
string requestUrl = Request.Path.Replace(Request.ApplicationPath, string.Empty).TrimEnd('/').ToUpperInvariant();
|
||||||
string modelUrl = Model.Href.Replace(Request.ApplicationPath, string.Empty).TrimEnd('/').ToUpperInvariant();
|
string modelUrl = Model.Href.Replace(Request.ApplicationPath, string.Empty).TrimEnd('/').ToUpperInvariant();
|
||||||
if ((!string.IsNullOrEmpty(modelUrl) && requestUrl.StartsWith(modelUrl)) || requestUrl == modelUrl) {
|
if (requestUrl == modelUrl) {
|
||||||
Model.Classes.Add("current");
|
Model.Classes.Add("current");
|
||||||
}
|
}
|
||||||
if(items.Any()) {
|
if(items.Any()) {
|
||||||
|
Reference in New Issue
Block a user