Skip to content

Replaced $.bind with $.on #7760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 75 additions & 70 deletions src/Plugins/Nop.Plugin.Misc.RFQ/Views/Admin/AdminQuotes.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

@{
const string hideSearchBlockAttributeName = "AdminQuotes.HideSearchBlock";
var hideSearchBlock = await genericAttributeService.GetAttributeAsync<bool>(await workContext.GetCurrentCustomerAsync(), hideSearchBlockAttributeName);
var hideSearchBlock = await genericAttributeService.GetAttributeAsync<bool>(await workContext.GetCurrentCustomerAsync(),
hideSearchBlockAttributeName);
}

<form asp-controller="RfqAdmin" asp-action="AdminQuotes" method="post">
Expand All @@ -22,15 +23,17 @@
</h1>
<div class="float-right">
<button type="submit" id="btnCreate" name="btnCreate" style="display: none"></button>
<button type="submit" id="btnCreateNewQuote" onclick="javascript:OpenWindow('@Url.Action("SelectCustomerPopup", "RfqAdmin", new { btnId = "btnCreate", productIdInput = Html.IdFor(model => model.CustomerId) })', 800, 850, true); return false;" class="btn btn-info">
<button type="submit" id="btnCreateNewQuote"
onclick="javascript:OpenWindow('@Url.Action("SelectCustomerPopup", "RfqAdmin", new { btnId = "btnCreate", productIdInput = Html.IdFor(model => model.CustomerId) })', 800, 850, true); return false;"
class="btn btn-info">
<i class="fas fa-plus-square"></i>
@T("Plugins.Misc.RFQ.CreateNew")
</button>
<button type="button" id="delete-selected" name="delete-selected" class="btn btn-danger">
<i class="far fa-trash-alt"></i>
@T("Plugins.Misc.RFQ.DeleteSelected")
</button>
<nop-action-confirmation asp-button-id="delete-selected"/>
<nop-action-confirmation asp-button-id="delete-selected" />
</div>
</div>

Expand All @@ -40,10 +43,12 @@
<div class="cards-group">
<div class="card card-default card-search">
<div class="card-body">
<div class="row search-row @(!hideSearchBlock ? "opened" : "")" data-hideAttribute="@hideSearchBlockAttributeName">
<div class="row search-row @(!hideSearchBlock ? "opened" : "")"
data-hideAttribute="@hideSearchBlockAttributeName">
<div class="search-text">@T("Admin.Common.Search")</div>
<div class="icon-search"><i class="fas fa-search" aria-hidden="true"></i></div>
<div class="icon-collapse"><i class="far fa-angle-@(!hideSearchBlock ? "up" : "down")" aria-hidden="true"></i></div>
<div class="icon-collapse"><i class="far fa-angle-@(!hideSearchBlock ? "up" : "down")"
aria-hidden="true"></i></div>
</div>

<div class="search-body @(hideSearchBlock ? "closed" : "")">
Expand All @@ -52,36 +57,37 @@
<div class="col-md-5">
<div class="form-group row">
<div class="col-md-4">
<nop-label asp-for="CreatedOnFrom"/>
<nop-label asp-for="CreatedOnFrom" />
</div>
<div class="col-md-8">
<nop-editor asp-for="CreatedOnFrom"/>
<nop-editor asp-for="CreatedOnFrom" />
</div>
</div>
<div class="form-group row">
<div class="col-md-4">
<nop-label asp-for="CreatedOnTo"/>
<nop-label asp-for="CreatedOnTo" />
</div>
<div class="col-md-8">
<nop-editor asp-for="CreatedOnTo"/>
<nop-editor asp-for="CreatedOnTo" />
</div>
</div>
</div>
<div class="col-md-7">
<div class="form-group row">
<div class="col-md-4">
<nop-label asp-for="CustomerEmail"/>
<nop-label asp-for="CustomerEmail" />
</div>
<div class="col-md-8">
<nop-editor asp-for="CustomerEmail"/>
<nop-editor asp-for="CustomerEmail" />
</div>
</div>
<div class="form-group row">
<div class="col-md-4">
<nop-label asp-for="QuoteStatus"/>
<nop-label asp-for="QuoteStatus" />
</div>
<div class="col-md-8">
<nop-select asp-for="QuoteStatus" asp-items="Model.AvailableQuoteStatuses"/>
<nop-select asp-for="QuoteStatus"
asp-items="Model.AvailableQuoteStatuses" />
</div>
</div>
</div>
Expand All @@ -103,64 +109,64 @@
@await Html.PartialAsync("Table", new DataTablesModel
{
Name = "quotes-grid",
UrlRead = new DataUrl("QuoteList", "RfqAdmin", null),
SearchButtonId = "search-log",
Length = Model.PageSize,
LengthMenu = Model.AvailablePageSizes,
Filters = new List<FilterParameter>
{
new(nameof(Model.CreatedOnFrom)),
new(nameof(Model.CreatedOnTo)),
new(nameof(Model.CustomerEmail)),
new(nameof(Model.QuoteStatus))
},
ColumnCollection = new List<ColumnProperty>
{
new(nameof(QuoteModel.Id))
{
IsMasterCheckBox = true,
Render = new RenderCheckBox("checkbox_log"),
ClassName = NopColumnClassDefaults.CenterAll,
Width = "50"
},
new(nameof(QuoteModel.CreatedOn))
{
Title = T("Plugins.Misc.RFQ.Fields.Quote.CreatedOn").Text,
Width = "200",
Render = new RenderDate()
},
new(nameof(QuoteModel.ExpirationDateUtc))
{
Title = T("Plugins.Misc.RFQ.Fields.Quote.ExpirationDate").Text,
Width = "200",
Render = new RenderDate()
},
new(nameof(QuoteModel.Status))
{
Title = T("Plugins.Misc.RFQ.Fields.Quote.Status").Text,
Encode = false,
Width = "200",
},
new(nameof(QuoteModel.CustomerEmail))
{
Title = T("Plugins.Misc.RFQ.Fields.CustomerEmail").Text,
Encode = true,
Width = "200",
},
new(nameof(QuoteModel.Id))
{
Title = T("Admin.Common.View").Text,
Width = "100",
ClassName = NopColumnClassDefaults.Button,
Render = new RenderButtonView(new DataUrl("~/Admin/RfqAdmin/AdminQuote"))
}
}
})
UrlRead = new DataUrl("QuoteList", "RfqAdmin", null),
SearchButtonId = "search-log",
Length = Model.PageSize,
LengthMenu = Model.AvailablePageSizes,
Filters = new List<FilterParameter>
{
new(nameof(Model.CreatedOnFrom)),
new(nameof(Model.CreatedOnTo)),
new(nameof(Model.CustomerEmail)),
new(nameof(Model.QuoteStatus))
},
ColumnCollection = new List<ColumnProperty>
{
new(nameof(QuoteModel.Id))
{
IsMasterCheckBox = true,
Render = new RenderCheckBox("checkbox_log"),
ClassName = NopColumnClassDefaults.CenterAll,
Width = "50"
},
new(nameof(QuoteModel.CreatedOn))
{
Title = T("Plugins.Misc.RFQ.Fields.Quote.CreatedOn").Text,
Width = "200",
Render = new RenderDate()
},
new(nameof(QuoteModel.ExpirationDateUtc))
{
Title = T("Plugins.Misc.RFQ.Fields.Quote.ExpirationDate").Text,
Width = "200",
Render = new RenderDate()
},
new(nameof(QuoteModel.Status))
{
Title = T("Plugins.Misc.RFQ.Fields.Quote.Status").Text,
Encode = false,
Width = "200",
},
new(nameof(QuoteModel.CustomerEmail))
{
Title = T("Plugins.Misc.RFQ.Fields.CustomerEmail").Text,
Encode = true,
Width = "200",
},
new(nameof(QuoteModel.Id))
{
Title = T("Admin.Common.View").Text,
Width = "100",
ClassName = NopColumnClassDefaults.Button,
Render = new RenderButtonView(new DataUrl("~/Admin/RfqAdmin/AdminQuote"))
}
}
})

<script>
$(function() {
$(function () {
//"delete selected" button
$("#delete-selected-action-confirmation-submit-button").bind("click", function () {
$("#delete-selected-action-confirmation-submit-button").on("click", function () {
var postData = {
selectedIds: selectedIds
};
Expand All @@ -175,8 +181,7 @@
showAlert('deleteSelectedFailed', errorThrown);
},
complete: function (jqXHR, textStatus) {
if (jqXHR.status === 204)
{
if (jqXHR.status === 204) {
showAlert('nothingSelectedAlert', '@T("Admin.Common.Alert.NothingSelected")');
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<script>
$(function() {
//"delete selected" button
$("#delete-selected-action-confirmation-submit-button").bind("click", function () {
$("#delete-selected-action-confirmation-submit-button").on("click", function () {
var postData = {
selectedIds: selectedIds
};
Expand Down
4 changes: 2 additions & 2 deletions src/Plugins/Nop.Plugin.Misc.Zettle/Views/Configure.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
return false;
});

$('#start-sync-action-confirmation-submit-button').bind('click', function () {
$('#start-sync-action-confirmation-submit-button').on('click', function () {
$.ajax({
cache: false,
type: 'GET',
Expand All @@ -350,7 +350,7 @@
return false;
});

$('#delete-selected-action-confirmation-submit-button').bind('click', function () {
$('#delete-selected-action-confirmation-submit-button').on('click', function () {
var postData = {
selectedIds: selectedIds
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
return false;
});

$('#start-sync-action-confirmation-submit-button').bind('click', function () {
$('#start-sync-action-confirmation-submit-button').on('click', function () {
$.ajax({
cache: false,
type: 'GET',
Expand All @@ -206,7 +206,7 @@
return false;
});

$('#delete-selected-items-action-confirmation-submit-button').bind('click', function () {
$('#delete-selected-items-action-confirmation-submit-button').on('click', function () {
var postData = {
selectedIds: selectedIds
};
Expand All @@ -232,7 +232,7 @@
return false;
});

$('#clear-all-items-action-confirmation-submit-button').bind('click', function () {
$('#clear-all-items-action-confirmation-submit-button').on('click', function () {
$.ajax({
cache: false,
type: 'GET',
Expand Down
4 changes: 2 additions & 2 deletions src/Plugins/Nop.Plugin.Tax.Avalara/Views/Log/List.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

<script>
$(function() {
$('#delete-selected-action-confirmation-submit-button').bind('click', function () {
$('#delete-selected-action-confirmation-submit-button').on('click', function () {
var postData = {
selectedIds: selectedIds
};
Expand All @@ -112,7 +112,7 @@
return false;
});

$('#clear-all-action-confirmation-submit-button').bind('click', function () {
$('#clear-all-action-confirmation-submit-button').on('click', function () {
$.ajax({
cache: false,
type: 'GET',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
checkAdvancedSettingsMode($("#advanced-settings-mode").is(':checked'));
$(document).ready(function () {
$('#onoffswitch-rate-action-confirmation-submit-button').bind('click', function () {
$('#onoffswitch-rate-action-confirmation-submit-button').on('click', function () {
var postData = {
value: !($("#advanced-settings-mode").is(':checked'))
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
<script>
$(function() {
//"delete selected" button
$("#delete-selected-action-confirmation-submit-button").bind("click", function () {
$("#delete-selected-action-confirmation-submit-button").on("click", function () {
var postData = {
selectedIds: selectedIds
};
Expand Down
Loading