Skip to content

Commit 0da2780

Browse files
committed
UI: implemented flex modal dialog (body fills available window area)
1 parent ee6246e commit 0da2780

6 files changed

Lines changed: 69 additions & 14 deletions

File tree

src/Libraries/SmartStore.Core/Domain/Common/CommonSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public CommonSettings()
1313
SitemapIncludeTopics = true;
1414
FullTextMode = FulltextSearchMode.ExactMatch;
1515
AutoUpdateEnabled = true;
16-
EntityPickerPageSize = 24;
16+
EntityPickerPageSize = 48;
1717
}
1818

1919
public bool UseSystemEmailForContactUsForm { get; set; }

src/Presentation/SmartStore.Web/Content/bootstrap/custom/custom.less

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,67 @@ th label {
503503
margin: -250px 0 0 -400px !important;
504504
}
505505

506+
507+
// XLARGE MODAL
508+
// ------------------------------
509+
506510
.modal-xlarge {
507511
width: 960px !important;
508512
margin: -250px 0 0 -480px !important;
513+
}
514+
515+
516+
// FLEX MODAL
517+
// ------------------------------
518+
519+
.modal-flex {
520+
top: 3% !important;
521+
bottom: 3% !important;
522+
margin-top: 0 !important;
523+
margin-bottom: 0 !important;
524+
-webkit-box-orient: vertical;
525+
-webkit-box-direction: normal;
526+
-webkit-flex-direction: column;
527+
-ms-flex-direction: column;
528+
flex-direction: column;
529+
530+
&.fade.in {
531+
display: -webkit-box !important;
532+
display: -webkit-flex !important;
533+
display: -ms-flexbox !important;
534+
display: flex !important;
535+
}
536+
537+
.modal-body {
538+
max-height: initial;
539+
overflow-y: auto;
540+
overflow-x: hidden;
541+
.display-flex();
542+
-webkit-flex-direction: row;
543+
-ms-flex-direction: row;
544+
flex-direction: row;
545+
-webkit-box-flex: 1;
546+
-webkit-flex: 1;
547+
-ms-flex: 1;
548+
flex: 1;
549+
-webkit-box-pack: start;
550+
-webkit-justify-content: flex-start;
551+
-ms-flex-pack: start;
552+
justify-content: flex-start;
553+
-webkit-box-align: stretch;
554+
-webkit-align-items: stretch;
555+
-ms-flex-align: stretch;
556+
align-items: stretch;
557+
-webkit-align-content: stretch;
558+
-ms-flex-line-pack: stretch;
559+
align-content: stretch;
560+
}
561+
562+
.modal-flex-fill-area {
563+
//overflow: hidden;
564+
-webkit-box-flex: 1;
565+
-webkit-flex: 1;
566+
-ms-flex: 1;
567+
flex: 1;
568+
}
509569
}

src/Presentation/SmartStore.Web/Content/smartstore.entitypicker.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
.entity-picker-list .list-footer {
7777
clear: both;
78-
padding: 8px 12px 0 12px;
78+
padding: 12px;
7979
text-align: center;
8080
}
8181

@@ -89,6 +89,8 @@
8989
display: table-cell;
9090
width: 54px;
9191
height: 54px;
92+
max-width: 54px;
93+
max-height: 54px;
9294
padding: 2px;
9395
text-align: center;
9496
vertical-align: middle;

src/Presentation/SmartStore.Web/Controllers/CommonController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ protected PdfReceiptHeaderFooterModel PreparePdfReceiptHeaderFooterModel(int sto
10221022

10231023
public ActionResult EntityPicker(EntityPickerModel model)
10241024
{
1025-
model.PageSize = _commonSettings.EntityPickerPageSize;
1025+
model.PageSize = 48; // _commonSettings.EntityPickerPageSize;
10261026
model.AllString = T("Admin.Common.All");
10271027

10281028
if (model.Entity.IsCaseInsensitiveEqual("product"))
@@ -1051,7 +1051,7 @@ public ActionResult EntityPicker(EntityPickerModel model)
10511051
[HttpPost]
10521052
public ActionResult EntityPicker(EntityPickerModel model, FormCollection form)
10531053
{
1054-
model.PageSize = _commonSettings.EntityPickerPageSize;
1054+
model.PageSize = 48; // _commonSettings.EntityPickerPageSize;
10551055
model.PublishedString = T("Common.Published");
10561056
model.UnpublishedString = T("Common.Unpublished");
10571057

src/Presentation/SmartStore.Web/Scripts/smartstore.entityPicker.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,6 @@
217217
}
218218
});
219219

220-
// show more items
221-
dialog.on('click', 'a.entity-picker-showmore', function (e) {
222-
e.preventDefault();
223-
fillList(this, { append: true });
224-
return false;
225-
});
226-
227220
// item select and item hover
228221
dialog.find('.entity-picker-list').on('click', '.item', function (e) {
229222
var item = $(this);

src/Presentation/SmartStore.Web/Views/Common/EntityPicker.cshtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
@model EntityPickerModel
22
@using SmartStore.Web.Models.Common;
33

4-
<div id="entity-picker-@(Model.Entity)-dialog" class="entity-picker modal modal-xlarge hide fade" tabindex="-1">
4+
<div id="entity-picker-@(Model.Entity)-dialog" class="entity-picker modal modal-xlarge modal-flex hide fade" tabindex="-1">
55
<div class="modal-header">
66
<button type="button" class="close" data-dismiss="modal"><b>&#215;</b></button>
77
<h4 class="caption">&nbsp;</h4>
88
</div>
99
<div class="modal-body">
10-
<form method="POST" action="@Url.Action("EntityPicker", "Common", new { area = "" })">
10+
<form method="POST" class="modal-flex-fill-area" action="@Url.Action("EntityPicker", "Common", new { area = "" })">
1111
<input type="hidden" name="Entity" value="@Model.Entity" />
1212
<input type="hidden" name="HighligtSearchTerm" value="@Model.HighligtSearchTerm.ToString()" />
1313
<input type="hidden" name="ReturnField" value="@Model.ReturnField" />
@@ -28,7 +28,7 @@
2828
<span class="default hide">@T(Model.MaxReturnValues == 1 ? "Common.EntityPicker.SinglePickNote" : "Common.EntityPicker.MultiPickNote")</span>
2929
<span class="not-selectable hide">@T("Common.NotSelectable").</span>
3030
</span>
31-
<button class="btn btn-primary" disabled="disabled">@T("Common.OK")</button>
31+
<button class="btn btn-primary" disabled="disabled">@T("Common.Apply")</button>
3232
<button class="btn" data-dismiss="modal">@T("Common.Cancel")</button>
3333
</div>
3434
<script type="text/javascript">

0 commit comments

Comments
 (0)