diff --git a/apps/common/main/lib/component/FocusManager.js b/apps/common/main/lib/component/FocusManager.js
index 1557905d1..c1b361446 100644
--- a/apps/common/main/lib/component/FocusManager.js
+++ b/apps/common/main/lib/component/FocusManager.js
@@ -46,90 +46,7 @@ if (Common.UI === undefined) {
Common.UI = {};
}
-Common.UI.FocusManager = function (tabindex, parent) {
- var register = function(fields, options, tabindex) {
- var arr = [],
- selector,
- el;
- if (typeof options==='string') {
- selector = options;
- } else {
- el = options;
- }
- if (!fields.forEach) {
- fields = [fields];
- if (el)
- el = [el];
- }
-
- fields.forEach(function(cmp, index) {
- var elem = selector ? (cmp.$el || $(cmp.el)).find(selector).addBack().filter(selector) : (el && el[index] ? el[index] : cmp);
- elem && elem.attr && elem.attr('tabindex', tabindex.toString());
- arr.push({
- cmp: cmp,
- el: elem,
- selector: selector
- });
- });
- return arr;
- };
-
- return {
- tabindex: tabindex || 0,
- parent: parent,
- fields: [],
-
- add: function(fields, options) { // options may be selector or component.el
- this.fields = this.fields.concat(register(fields, options, this.tabindex));
- !this.trapFirst && this.addTraps();
- },
-
- insert: function(field, index, options) {
- this.fields.splice(index, 0, register(field, options, this.tabindex));
- },
-
- remove: function(index) {
- this.fields.splice(index, 1);
- },
-
- addTraps: function() {
- if (!this.parent || !this.parent.$window) return;
-
- var me = this;
- this.trapFirst = $('');
- this.trapFirst.on('focus', function() {
- for (var i=0; i');
- this.trapLast.on('focus', function() {
- for (var i=me.fields.length-1; i>=0; i--) {
- var field = me.fields[i];
- if ((field.cmp.isVisible ? field.cmp.isVisible() : field.cmp.is(':visible')) && !(field.cmp.isDisabled && field.cmp.isDisabled())) {
- var el = (field.selector) ? (field.cmp.$el || $(field.cmp.el)).find(field.selector).addBack().filter(field.selector) : field.el;
- el.focus();
- break;
- }
- }
- });
- this.parent.$window.append(this.trapLast);
- },
-
- setTabIndex: function (tabindex) {
- this.tabindex = tabindex;
- }
- }
-};
-
-Common.UI.FocusManager2 = new(function() {
+Common.UI.FocusManager = new(function() {
var _tabindex = 1,
_windows = [],
_count = 0;
diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js
index d308c2bf8..6c9ad704a 100644
--- a/apps/common/main/lib/component/Window.js
+++ b/apps/common/main/lib/component/Window.js
@@ -613,9 +613,6 @@ define([
!this.initConfig.id && (this.initConfig.id = 'window-' + this.cid);
!this.initConfig.tpl && (this.initConfig.tpl = '');
- if (options.focusManager)
- this.focusManager = Common.UI.FocusManager(1, this);
-
Common.UI.BaseView.prototype.initialize.call(this, this.initConfig);
},
diff --git a/apps/spreadsheeteditor/main/app/view/FormulaWizard.js b/apps/spreadsheeteditor/main/app/view/FormulaWizard.js
index 1fdfa4ebf..212f6eaf8 100644
--- a/apps/spreadsheeteditor/main/app/view/FormulaWizard.js
+++ b/apps/spreadsheeteditor/main/app/view/FormulaWizard.js
@@ -282,7 +282,7 @@ define([
me.args[argcount].lblName.html(me.args[argcount].argName);
me.args[argcount].lblValue.html('= '+ ( argres!==null && argres!==undefined ? argres : '' + me.args[argcount].argTypeName + ''));
- Common.UI.FocusManager2.add(this, txt);
+ Common.UI.FocusManager.add(this, txt);
},
onInputChanging: function(input, newValue, oldValue, e) {