password input

View: New views
3 Messages — Rating Filter:   Alert me  

password input

by marun :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have been playing with LINB for a few days and I have noticed that there isn't password field. At the basis of linb.UI.Input I have written one.

--------------------------------8<------------------------------------------------------
CLASS("Password","linb.UI.Input",{
  initialize:function(){
    var template = this.getTemplate('');
    template.BOX.INPUT.type='password';
    this.setTemplate('',template);
  }
});
--------------------------------8<------------------------------------------------------

I have post it because one can need it.

Re: password input

by linb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Great!
-----------------------------------------------------------
CLASS("linb.UI.Password","linb.UI.Input",{
  initialize:function(){
    var template = this.getTemplate('');
    template.BOX.INPUT.type='password';
    this.setTemplate('',template);
  }
});
-----------------------------------------------------------
or,
-----------------------------------------------------------
var template = _.clone( linb.UI.Input.getTemplate('') );
template.BOX.INPUT.type='password';
this.setTemplate('password',template);
-----------------------------------------------------------

Re: password input

by marun :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Looking at the second solution isn't be better to put password widget as additional generic template to Input? It will reduce number of css files (reduce amount of css code to manage), because for most situations the same css will be used for Input and Password.
LightInTheBox - Buy quality products at wholesale price