123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- Ext.define('saas.view.auth.Dialog', {
- extend: 'Ext.form.Panel',
- xtype: 'authdialog',
- requires: [
- 'saas.view.auth.LoginController',
- 'Ext.form.Panel'
- ],
- /*
- * Seek out the first enabled, focusable, empty textfield when the form is focused
- */
- defaultFocus: 'textfield:focusable:not([hidden]):not([disabled]):not([value])',
- /**
- * @cfg {Boolean} [autoComplete=false]
- * Enables browser (or Password Managers) support for autoCompletion of User Id and
- * password.
- */
- autoComplete : false,
- initComponent: function () {
- var me = this, listen;
- if (me.autoComplete) {
- // Use standard FORM tag for detection by browser or password tools
- me.autoEl = Ext.applyIf(
- me.autoEl || {},
- {
- tag: 'form',
- name: 'authdialog',
- method: 'post'
- });
- }
- me.addCls('auth-dialog');
- me.callParent();
- if (me.autoComplete) {
- listen = {
- afterrender : 'doAutoComplete',
- scope : me,
- single : true
- };
- Ext.each(me.query('textfield'), function (field) {
- field.on(listen);
- });
- }
- },
- doAutoComplete : function(target) {
- if (target.inputEl && target.autoComplete !== false) {
- target.inputEl.set({ autocomplete: 'on' });
- }
- }
- });
|