SjonHortensius / pfsense

We are migrating pfSense to bootstrap!
Other
31 stars 6 forks source link

Feature request - button type #220

Closed sbeaver-netgate closed 8 years ago

sbeaver-netgate commented 9 years ago

It would be convenient to be able to set the button type for times when 'submit' is not appropriate. e.g.:

$btnadv = new Form_Button(
    'btnadv',
    'Advanced',
    null,
    'button'
));

// Or perhaps a little cleaner:

$btnadv = new Form_Button(
    'btnadv',
    'Advanced'
))->setType('button');

It would default to 'submit' of course.

SjonHortensius commented 9 years ago

The 'advanced' buttons should be removed, this is a typical javascript issue. These buttons don't belong in the php code

sbeaver-netgate commented 9 years ago

I find this ambiguous. Do you suggest that the “Advanced” button functionality is removed and that all of the input elements previously controlled by such a button should be displayed at all times, or is it your suggestion that the functionality is retained but implemented in JS (as I have done in the pages converted so far)

Steve

Stephen Beaver | +1 (512) 646-4100;239 | sbeaver@netgate.com | www.netgate.com

On May 21, 2015, at 3:58 AM, SjonHortensius notifications@github.com wrote:

The 'advanced' buttons should be removed, this is a typical javascript issue. These buttons don't belong in the php code

— Reply to this email directly or view it on GitHub https://github.com/SjonHortensius/pfsense/issues/220#issuecomment-104171021.

SjonHortensius commented 9 years ago

I suggest the functionality is moved to the global javascripts, and not implemented per-page. I want to implement this javascript, but that means you should apply the 'advanced' class to inputs

sbeaver-netgate commented 9 years ago

OK. You will see that I have written a number of Javascript functions to hide/show input elements and have used these in a consistent way in several pages recently. Those functioned could/should move to pfSense.js I find this solution to be flexible and effective, buy I’ll wait until you get to those pages for review.

Note that some pages have three or four “Advanced” buttons controlling the same number of input element groups.

Steve

Stephen Beaver | +1 (512) 646-4100;239 | sbeaver@netgate.com | www.netgate.com

On May 21, 2015, at 5:42 AM, SjonHortensius notifications@github.com wrote:

I suggest the functionality is moved to the global javascripts, and not implemented per-page. I want to implement this javascript, but that means you should apply the 'advanced' class to inputs

On Thu, May 21, 2015 at 11:32 AM, Steve Beaver notifications@github.com wrote:

I find this ambiguous. Do you suggest that the “Advanced” button functionality is removed and that all of the input elements previously controlled by such a button should be displayed at all times, or is it your suggestion that the functionality is retained but implemented in JS (as I have done in the pages converted so far)

Steve

Stephen Beaver | +1 (512) 646-4100;239 | sbeaver@netgate.com | www.netgate.com

On May 21, 2015, at 3:58 AM, SjonHortensius notifications@github.com wrote:

The 'advanced' buttons should be removed, this is a typical javascript issue. These buttons don't belong in the php code

— Reply to this email directly or view it on GitHub < https://github.com/SjonHortensius/pfsense/issues/220#issuecomment-104171021 .

— Reply to this email directly or view it on GitHub https://github.com/SjonHortensius/pfsense/issues/220#issuecomment-104198632 .

— Reply to this email directly or view it on GitHub https://github.com/SjonHortensius/pfsense/issues/220#issuecomment-104204355.

sbeaver-netgate commented 9 years ago

Thanks Sjon. I very much agree that this is how it should be handled.

[...]

SjonHortensius commented 9 years ago

@SanderVanLeeuwen have implemented this, but am not sure where the 'toggle advanced options' button should go (maybe btn-xs in panel-header?). There is also an issue where the inputs aren't properly hidden onload, any idea how to correct that? This can be tested on /services_dnsmasq.php