mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Devices - Edit: Revise and simplify javascript.
This commit is contained in:
@@ -1669,25 +1669,17 @@
|
||||
echo "</form>";
|
||||
|
||||
echo "<script>\n";
|
||||
// trigger initial onchage to set button state
|
||||
echo " $(window).on('load', function(event){\n";
|
||||
// triger initial onchage to set button state
|
||||
echo " $('#device_profile_uuid').trigger('change')";
|
||||
echo " $('#device_profile_uuid').trigger('change')";
|
||||
echo " });\n";
|
||||
//capture enter key to submit form
|
||||
echo " $(window).keypress(function(event){\n";
|
||||
echo " if (event.which == 13) { submit_form(); }\n";
|
||||
echo " });\n";
|
||||
// capture device selection events
|
||||
echo " $('#device_profile_uuid').on('change',function(event){ \n";
|
||||
echo " if (this.value == '') {\$('#device_profile_edit').hide()} else {\$('#device_profile_edit').show()} \n";
|
||||
//capture device selection events
|
||||
echo " $('#device_profile_uuid').on('change',function(event){ \n";
|
||||
echo " if (this.value == '') {\$('#device_profile_edit').hide()} else {\$('#device_profile_edit').show()} \n";
|
||||
echo " }); \n";
|
||||
// convert password fields to
|
||||
//hide password fields before submit
|
||||
echo " function submit_form() {\n";
|
||||
echo " $('form#frm').submit();\n";
|
||||
echo " }\n";
|
||||
echo " function submit_form_2() {\n";
|
||||
echo " $('input:password').css('visibility','hidden');\n";
|
||||
echo " $('input:password').attr({type:'text'});\n";
|
||||
echo " hide_password_fields();\n";
|
||||
echo " $('form#frm').submit();\n";
|
||||
echo " }\n";
|
||||
echo "</script>\n";
|
||||
|
||||
Reference in New Issue
Block a user