--HG--
branch : dev
This commit is contained in:
Suha Can
2011-03-24 12:43:11 -07:00
3 changed files with 14 additions and 8 deletions

View File

@@ -113,11 +113,8 @@ namespace Orchard.Widgets.Controllers {
return RedirectToAction("Index");
}
LayerPart currentLayer = layerId == null
? layers.First()
: layers.FirstOrDefault(layer => layer.Id == layerId);
if (currentLayer == null && layerId != null) { // Incorrect layer id passed
LayerPart currentLayer = layers.FirstOrDefault(layer => layer.Id == layerId);
if (currentLayer == null) { // Incorrect layer id passed
Services.Notifier.Error(T("Layer not found: {0}", layerId));
return RedirectToAction("Index");
}

View File

@@ -151,6 +151,9 @@ margin-top:5px;
#widgets-layer-visibility {
margin-top:20px;
}
#widgets-layer-visibility li {
cursor:default;
}
#widgets-layer-visibility .widgets-other-layer {
background-image:url(images/eye.png);
background-position:5px 11px;

View File

@@ -6,7 +6,7 @@
}
<script type="text/javascript">
//<![CDATA[
document.write("<div id=\"widgets-layer-visibility\"><h3>Layers With Widgets:</h3></div>");
document.write("<div id=\"widgets-layer-visibility\"><h3>All Layers:</h3></div>");
//]]>
</script>
@using(Script.Foot()) {
@@ -25,11 +25,17 @@
var widgetPlacement = $("#widgets-zones");
for (var i = 0; i < layers.length; i++) {
var layersWidgets = widgetPlacement.find(".widgets-layer-" + layers[i].id);
var layer = "";
if (layersWidgets.length > 0) {
var layer = $("<li class=\"widgets-" + ((layers[i].id == currentLayerId && "this") || "other") + "-layer\">" + layers[i].name + "</li>");
layer = $("<li class=\"widgets-" + ((layers[i].id == currentLayerId && "this") || "other") + "-layer\">" + layers[i].name + "</li>");
layer.data("widgets", layersWidgets);
visContainer.append(layer);
}
else {
layer = $("<li class=\"widgets-empty-layer\">" + layers[i].name + " <span>[empty]<span></li>");
}
visContainer.append(layer);
}
$("#widgets-layer-visibility .widgets-other-layer").live("click", function() {