Skip to content

Commit

Permalink
send command on enter, clean output before send #100
Browse files Browse the repository at this point in the history
  • Loading branch information
reloxx13 committed Jun 21, 2018
1 parent 4434274 commit 2026aa4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tasmoadmin/resources/js/devices.js
Expand Up @@ -66,6 +66,13 @@ function initCommandHelper() {
$( ".cmdContainer " ).find( "#commandInputError" ).html( "" );
} );

$( ".cmdContainer " ).find( "input" ).keypress( function ( e ) {
if ( e.which == 13 ) {//Enter key pressed
$( ".sendCommand" ).click();//Trigger search button click event
}
} );


$( ".select_all" ).change( function () { //"select all" change
var status = this.checked; // "select all" checked status
$( '.device_checkbox' ).each( function () { //iterate all listed checkbox items
Expand Down Expand Up @@ -100,7 +107,7 @@ function initCommandHelper() {
.parent()
.parent().removeClass( "has-error" )
.find( "#commandInputError" )
.addClass( "d-none" );
.addClass( "d-none" ).html( "" );

var selectedDevices = $.map( $( ".cmd_cb:not(.link ) input:not(.select_all):checked" ), function ( elem, idx ) {
let d = new Array( $( elem ).val() );
Expand Down

0 comments on commit 2026aa4

Please sign in to comment.