Popup Mod
Default popup can be replaced by setting
awe.popup
PopupDemo/PopupMod.cshtml
@{
ViewData["Title"] = "Popup Mod";
}
<div class="expl">
Default popup can be replaced by setting <code>awe.popup</code>
</div>
<script>
function setPopup(p) {
awe.popup = function (o) {
if (o.tag && o.tag.DropdownPopup) {
return awem.dropdownPopup(o);
} else if (o.tag && o.tag.Inline) {
return awem.inlinePopup(o);
} else {
return p(o);
}
}
// close popups that were already opened with a different kind of popup
$('.awe-popup').each(function () {
if ($(this).data('api'))
$(this).data('api').destroy();
});
$('.awe-multilookup, .awe-lookup').each(function () { $(this).data('api').initPopup(); });
awe.flash($('#testArea'));
}
$(function () {
$('#btnAwe').click(function () {
setPopup(awem.dropdownPopup);
});
$('#btnInline').click(function () {
setPopup(awem.inlinePopup);
});
});
</script>
<button type="button" id="btnAwe" class="awe-btn">set awesome popup</button>
<button type="button" id="btnInline" class="awe-btn">set inline popup</button>
@(Html.Awe().InitPopup(new PopupOpt
{
Name = "popup1",
Url = Url.Action("Popup1"),
LoadOnce = true,
Title = "popup title",
Width = 500,
Height = 450
}))
<br />
<br />
<br />
<div id="testArea" style="padding: 1em 0;">
@Html.Awe().Button().Text("Open Popup").OnClick(Html.Awe().OpenPopup("popup1"))
</div>
<div class="tabs code">
<div data-caption="view">@Html.Source("PopupDemo/PopupMod.cshtml")</div>
</div>
Comments