Project

General

Profile

« Previous | Next » 

Revision 96c18fe4

Added by Stephen Beaver almost 10 years ago

Addresses #5159 by removing hide/show/disable/enable functions to included file

View differences:

src/usr/local/www/services_dhcp.php
1337 1337
<script>
1338 1338
//<![CDATA[
1339 1339
events.push(function(){
1340
	var visible = false;
1341

  
1342
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
1343
	function hideInput(id, hide) {
1344
		if(hide)
1345
			$('#' + id).parent().parent('div').addClass('hidden');
1346
		else
1347
			$('#' + id).parent().parent('div').removeClass('hidden');
1348
	}
1349

  
1350
	// Hides the <div> in which the specified group input element lives so that the input,
1351
	// its label and help text are hidden
1352
	function hideGroupInput(id, hide) {
1353
		if(hide)
1354
			$('#' + id).parent('div').addClass('hidden');
1355
		else
1356
			$('#' + id).parent('div').removeClass('hidden');
1357
	}
1358

  
1359
	// Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden
1360
	function hideCheckbox(id, hide) {
1361
		if(hide)
1362
			$('#' + id).parent().parent().parent('div').addClass('hidden');
1363
		else
1364
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
1365
	}
1366

  
1367
	// Disables the specified input element
1368
	function disableInput(id, disable) {
1369
		$('#' + id).prop("disabled", disable);
1370
	}
1371

  
1372
	// Hides all elements of the specified class. This will usually be a section
1373
	function hideClass(s_class, hide) {
1374
		if(hide)
1375
			$('.' + s_class).hide();
1376
		else
1377
			$('.' + s_class).show();
1378
	}
1379

  
1380
	// Hides all elements of the specified class assigned to a group. This will usually be a group
1381
	function hideGroupClass(s_class, hide) {
1382
		if(hide)
1383
			$('.' + s_class).parent().parent().parent().hide();
1384
		else
1385
			$('.' + s_class).parent().parent().parent().show();
1386
	}
1387 1340

  
1388 1341
	// Row add/delete function for class="repeatable" =================================================================
1389 1342

  

Also available in: Unified diff