سامانه صدور فاکتور و حسابداری
fix(ux): route F2 to company form when settings company panel has keyboard focus
davoodmehraban89 committed
Oct 12, 2026 at 00:09 UTC
13d50522baea53e7075aa3e7393180244fac97ab
1 file changed
+4
-1
js/ux-hardening-r2.js
+4
-1
@@ -151,7 +151,10 @@
151
'view-journal':'jeSaveManual',
152
'view-settings':'commitSaveDefaultSettings'
153
};
154
- const handler=window[ids[view]];
154
+ // Settings contains two distinct forms: company registration and default invoice settings.
155
+ const companyPanel=$('company-save-btn')?.closest('.accordion-item');
156
+ const actionId=view==='view-settings'&&companyPanel?.contains(document.activeElement)?'commitSaveCompany':ids[view];
157
+ const handler=window[actionId];
158
if(typeof handler!=='function')return f2Error('در این صفحه، فرم قابل ذخیرهای برای کلید F2 تعریف نشده است.');
159
// Do not turn approval of the manual voucher or a sales invoice into an implicit posting.
160
if(view==='view-journal'&&document.querySelector('[data-finora-task="documents"]')?.getClientRects().length>0)