mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 11:44:41 +08:00
Handling the case when closing MediaLibraryPickerField dialog without having selected anything to prevent a null reference javascript error.
--HG-- branch : 1.x
This commit is contained in:
@@ -92,6 +92,10 @@
|
|||||||
$('html, body').css('overflow', '');
|
$('html, body').css('overflow', '');
|
||||||
|
|
||||||
var selectedData = $.colorbox.selectedData;
|
var selectedData = $.colorbox.selectedData;
|
||||||
|
|
||||||
|
if (selectedData == null) // Dialog cancelled, do nothing
|
||||||
|
return;
|
||||||
|
|
||||||
for (var i = 0; i < selectedData.length; i++) {
|
for (var i = 0; i < selectedData.length; i++) {
|
||||||
|
|
||||||
var template = @Html.FieldIdFor(m => m.Field.Ids)_Template.replace(/\{contentItemId\}/g, selectedData[i].id).replace(/\{thumbnail\}/g, selectedData[i].thumbnail).replace(/\{title\}/g, selectedData[i].title);
|
var template = @Html.FieldIdFor(m => m.Field.Ids)_Template.replace(/\{contentItemId\}/g, selectedData[i].id).replace(/\{thumbnail\}/g, selectedData[i].thumbnail).replace(/\{title\}/g, selectedData[i].title);
|
||||||
|
|||||||
Reference in New Issue
Block a user