Project

General

Profile

« Previous | Next » 

Revision 24f15b3a

Added by NOYB NOYB over 9 years ago

WebGUI Left Column Labels Hyper

Touch Screen Usability Annoyance
https://forum.pfsense.org/index.php?topic=104135.0

Clicking the labels in the left column selects/activates the first item. This is the perfectly natural place for scrolling with thumb.

No big problem really for input fields, but check boxes and buttons are inadvertently selected/toggled resulting in unintended configuration changes.

Would be real nice if the labels in the left column were not "active".

This commit provides an option in System - General Setup page to enable/disable this "feature".

There is probably a better way, but this appears to be functional. For now at least it seems to work for me anyway. Just have to eliminate (null) the for attribute on the group labels so it doesn't have a target.

View differences:

src/usr/local/www/classes/Form/Group.class.php
108 108

  
109 109
	public function __toString()
110 110
	{
111
		global $config;
112

  
111 113
		$element = parent::__toString();
112 114

  
113 115
		// Automatically determine width for inputs without explicit set
......
134 136
		$inputs = implode('', $this->_inputs);
135 137
		$help = $this->_getHelp();
136 138

  
139
		if (!isset($config['system']['webgui']['webguileftcolumnhyper']))
140
			$target = null;
141

  
137 142
		$label = new Form_Element('label', false, ['for' => $target]);
138 143
		$label->addClass('col-sm-'.Form::LABEL_WIDTH, 'control-label');
139 144

  
src/usr/local/www/system.php
92 92
$pconfig['webguicss'] = $config['system']['webgui']['webguicss'];
93 93
$pconfig['webguifixedmenu'] = $config['system']['webgui']['webguifixedmenu'];
94 94
$pconfig['dashboardcolumns'] = $config['system']['webgui']['dashboardcolumns'];
95
$pconfig['webguileftcolumnhyper'] = isset($config['system']['webgui']['webguileftcolumnhyper']);
95 96
$pconfig['dnslocalhost'] = isset($config['system']['dnslocalhost']);
96 97

  
97 98
if (!$pconfig['timezone']) {
......
231 232
			set_language($config['system']['language']);
232 233
		}
233 234

  
235
		unset($config['system']['webgui']['webguileftcolumnhyper']);
236
		$config['system']['webgui']['webguileftcolumnhyper'] = $_POST['webguileftcolumnhyper'] ? true : false;
237

  
234 238
		/* XXX - billm: these still need updating after figuring out how to check if they actually changed */
235 239
		$olddnsservers = $config['system']['dnsserver'];
236 240
		unset($config['system']['dnsserver']);
......
502 506
	[min => 1, max => 4]
503 507
))->setHelp('<span class="badge" title="This feature is in BETA">BETA</span>');
504 508

  
509
$section->addInput(new Form_Checkbox(
510
	'webguileftcolumnhyper',
511
	'Left Column Labels',
512
	'Active',
513
	$pconfig['webguileftcolumnhyper']
514
))->setHelp('If selected, clicking a label in the left column will select/toggle the first item of the group.');
515

  
505 516
$form->add($section);
506 517

  
507 518
print $form;

Also available in: Unified diff