updates as per comments from murrant

This commit is contained in:
laf
2016-07-01 10:27:15 +01:00
parent 2664dbb5e0
commit 2bffc5c1b7
2 changed files with 6 additions and 3 deletions

View File

@@ -16,7 +16,7 @@
<th data-column-id='ifOperStatus'>Oper</th>
<th data-column-id='disabled' data-sortable='false'>Disable</th>
<th data-column-id='ignore' data-sortable='false'>Ignore</th>
<th data-column-id='ifSpeed'>ifSpeed</th>
<th data-column-id='ifSpeed'>ifSpeed (bits/s)</th>
<th data-column-id='port_tune' data-sortable='false' data-searchable='false'>RRD Tune</th>
<th data-column-id='ifAlias'>Description</th>
</tr>
@@ -67,7 +67,8 @@
}
});
});
$(document).on('blur', "[name='if-speed']", function (){
$(document).on('blur keyup', "[name='if-speed']", function (e){
if (e.type === 'keyup' && e.keyCode !== 13) return;
var $this = $(this);
var speed = $this.val();
var device_id = $this.data('device_id');
@@ -82,6 +83,8 @@
if (data.status == 'ok') {
$this.closest('.form-group').addClass('has-success');
$this.next().addClass('glyphicon-ok');
var new_val = speed.text().replace(/[^0-9]/gi, '');
$this.val(new_val);
setTimeout(function(){
$this.closest('.form-group').removeClass('has-success');
$this.next().removeClass('glyphicon-ok');