[ZBXNEXT-2215] Small code improvement in JS Created: 2014 Mar 19  Updated: 2014 Oct 07  Resolved: 2014 Sep 18

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Frontend (F)
Affects Version/s: 2.2.2
Fix Version/s: 2.5.0

Type: Change Request Priority: Trivial
Reporter: Adail Horst Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: javascript, jquery, squashable, trivial
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Only a code sugestion



 Description   

File: include/views/js/configuration.item.edit.js.php
Starting in line 123
Change of:
if (type == 0 || type == 7 || type == 3 || type == 5 || type == 8 || type == 17)

{ jQuery('#keyButton').prop('disabled', false); }

else

{ jQuery('#keyButton').prop('disabled', true); }

For more small code:
jQuery('#keyButton').prop('disabled', !(type == 0 || type == 7 || type == 3 || type == 5 || type == 8 || type == 17));



 Comments   
Comment by Alexander Vladishev [ 2014 Sep 16 ]

Better code:
jQuery('#keyButton').prop('disabled', type != 0 && type != 7 && type != 3 && type != 5 && type != 8 && type != 17)

Comment by Pavels Jelisejevs (Inactive) [ 2014 Sep 17 ]

Fixed directly in trunk r49086.

CLOSED.

Generated at Fri Mar 14 17:15:18 EET 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.