| Line 165... |
Line 165... |
| 165 |
} else {
|
165 |
} else {
|
| 166 |
alert("Please upload file!");
|
166 |
alert("Please upload file!");
|
| 167 |
}
|
167 |
}
|
| 168 |
return false;
|
168 |
return false;
|
| 169 |
});
|
169 |
});
|
| - |
|
170 |
// Fragment is re-injected with .html(), which re-runs this script; clear the
|
| - |
|
171 |
// namespace first so handlers replace rather than stack (one click would
|
| - |
|
172 |
// otherwise fire N identical requests and be rejected as duplicates).
|
| - |
|
173 |
$(document).off('.franacct');
|
| 170 |
$(document).on('click', "#accountsTemplate", function () {
|
174 |
$(document).on('click.franacct', "#accountsTemplate", function () {
|
| 171 |
window.location.href = context + "/franchiseeAccountCreationTemplate";
|
175 |
window.location.href = context + "/franchiseeAccountCreationTemplate";
|
| 172 |
});
|
176 |
});
|
| 173 |
|
177 |
|
| 174 |
$(document).on('click', '.edit-franchisee-account-btn', function () {
|
178 |
$(document).on('click.franacct', '.edit-franchisee-account-btn', function () {
|
| 175 |
var id = $(this).data('id');
|
179 |
var id = $(this).data('id');
|
| 176 |
doGetAjaxRequestHandler(context + "/franchisee/account/edit/" + id, function (response) {
|
180 |
doGetAjaxRequestHandler(context + "/franchisee/account/edit/" + id, function (response) {
|
| 177 |
$('#main-content').html(response); // Load edit form in content section
|
181 |
$('#main-content').html(response); // Load edit form in content section
|
| 178 |
});
|
182 |
});
|
| 179 |
});
|
183 |
});
|
| 180 |
|
184 |
|
| 181 |
$(document).on('click', '.open-edit-modal', function () {
|
185 |
$(document).on('click.franacct', '.open-edit-modal', function () {
|
| 182 |
var accountId = $(this).data('id');
|
186 |
var accountId = $(this).data('id');
|
| 183 |
$.get(context + "/franchisee/account/edit/" + accountId, function (data) {
|
187 |
$.get(context + "/franchisee/account/edit/" + accountId, function (data) {
|
| 184 |
// Populate modal fields
|
188 |
// Populate modal fields
|
| 185 |
$('#accountId').val(data.id);
|
189 |
$('#accountId').val(data.id);
|
| 186 |
$('#fofoId').val(data.fofoId);
|
190 |
$('#fofoId').val(data.fofoId);
|