forked from extern/egroupware
Better handling of target to support custom fields, now switches to the target tab
This commit is contained in:
parent
083255601a
commit
f9e1e1b2a6
@ -80,7 +80,13 @@ var et2_timestamper = (function(){ "use strict"; return et2_button.extend([],
|
|||||||
}
|
}
|
||||||
text += ': ';
|
text += ': ';
|
||||||
|
|
||||||
var input = this._get_input(this.target);
|
var widget = this._get_input(this.target);
|
||||||
|
var input = widget.input ? widget.input : widget.getDOMNode();
|
||||||
|
if(input.context)
|
||||||
|
{
|
||||||
|
input = input.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
var scrollPos = input.scrollTop;
|
var scrollPos = input.scrollTop;
|
||||||
var browser = ((input.selectionStart || input.selectionStart == "0") ?
|
var browser = ((input.selectionStart || input.selectionStart == "0") ?
|
||||||
"standards" : (document.selection ? "ie" : false ) );
|
"standards" : (document.selection ? "ie" : false ) );
|
||||||
@ -132,29 +138,37 @@ var et2_timestamper = (function(){ "use strict"; return et2_button.extend([],
|
|||||||
input.focus();
|
input.focus();
|
||||||
}
|
}
|
||||||
input.scrollTop = scrollPos;
|
input.scrollTop = scrollPos;
|
||||||
input.focus();
|
input.focus();
|
||||||
}
|
}
|
||||||
|
// If on a tab, switch to that tab so user can see it
|
||||||
|
var tab = widget;
|
||||||
|
while(tab._parent && tab._type != 'tabbox')
|
||||||
|
{
|
||||||
|
tab = tab._parent;
|
||||||
|
}
|
||||||
|
if (tab._type == 'tabbox') tab.activateTab(widget);
|
||||||
},
|
},
|
||||||
|
|
||||||
_get_input: function _get_input(target)
|
_get_input: function _get_input(target)
|
||||||
{
|
{
|
||||||
var input = null;
|
var input = null;
|
||||||
var widget = null;
|
var widget = null;
|
||||||
if(jQuery('#'+this.target).is('input'))
|
|
||||||
|
if (typeof target == 'string')
|
||||||
{
|
{
|
||||||
input = this.target;
|
widget = this.getRoot().getWidgetById(target);
|
||||||
}
|
|
||||||
else if (typeof target == 'string')
|
|
||||||
{
|
|
||||||
var widget = this.getRoot().getWidgetById(target);
|
|
||||||
}
|
}
|
||||||
else if (target.instanceOf && target.instanceOf(et2_IInput))
|
else if (target.instanceOf && target.instanceOf(et2_IInput))
|
||||||
{
|
{
|
||||||
widget = target;
|
widget = target;
|
||||||
}
|
}
|
||||||
|
else if(typeof target == 'string' && target.indexOf('#') < 0 && jQuery('#'+this.target).is('input'))
|
||||||
|
{
|
||||||
|
input = this.target;
|
||||||
|
}
|
||||||
if(widget)
|
if(widget)
|
||||||
{
|
{
|
||||||
input = widget.input ? widget.input : widget.getDOMNode();
|
return widget;
|
||||||
}
|
}
|
||||||
if(input.context)
|
if(input.context)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user