NetTalk Central

Author Topic: Header changes in login form  (Read 3589 times)

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Header changes in login form
« on: August 18, 2012, 12:04:08 PM »
Hello Bruce,

This is hard to explain..

In a login form (modified version of the shipped example), in mobile mode, the header changes when I click on the password field.  The header appears to change position and/or width. 

If I remove this 'nt-fix-center cus-width-300', the problem goes away but now my login form is not centered all nice and pretty in desktop mode.

This started happening several builds ago.  Don't know for sure which one.

I wish I had a way to screen capture on my Android phone.  This behavior does not happen in mobile mode on a desktop browser.

Anyway, I hope someone else tests this and can duplicate it.

Thanks,

Don

[attachment deleted by admin]
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11263
    • View Profile
Re: Header changes in login form
« Reply #1 on: August 19, 2012, 09:53:57 PM »
the centering css requires that you know the width of the form, and I would definitely recommend removing it in mobile mode.

>> If I remove this 'nt-fix-center cus-width-300', the problem goes away but now my login form is not centered all nice and pretty in desktop mode.

so make the CSS conditional on being in Desktop mode. CHOOSE is your friend, as is p_web.IsMobile().

Cheers
Bruce

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Header changes in login form
« Reply #2 on: August 20, 2012, 06:12:56 AM »
Awesome!  Thanks Bruce!
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: Header changes in login form
« Reply #3 on: August 20, 2012, 07:45:32 AM »
I got it working just after we ended our Skype conversation.

It was missing 'px' after the 300.

This works:

CHOOSE(p_web.IsMobile(),'',' nt-fix-center nt-width-300px')

I don't think "p_web.IsMobile = 1" is required .  I think CHOOSE evaluates that as either true or false automatically.

Thanks for the help!!!

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11263
    • View Profile
Re: Header changes in login form
« Reply #4 on: August 20, 2012, 09:44:45 PM »
you don't need the =1 if the function returns a number. However if it returns a string you can get unexpected results, so I always encourage using a complete expression when using Choose. It's a good habit to get into.

For example;
if the function returns a blank string then
Choose(func(),1,2)
and
Choose(func() = '',1,2)
will return different values.

Cheers
Bruce