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