Compose focus fixes (#547)

This commit is contained in:
RainLoop Team 2015-03-21 02:22:06 +04:00
parent 30b7ce263f
commit 4a90e2406c
6 changed files with 41 additions and 13 deletions

View file

@ -384,7 +384,6 @@
this.setHtml('', bFocus); this.setHtml('', bFocus);
}; };
module.exports = HtmlEditor; module.exports = HtmlEditor;
}()); }());

7
dev/External/ko.js vendored
View file

@ -688,6 +688,13 @@
'focusCallback': fFocusCallback, 'focusCallback': fFocusCallback,
'inputDelimiters': [',', ';'], 'inputDelimiters': [',', ';'],
'autoCompleteSource': fAutoCompleteSource, 'autoCompleteSource': fAutoCompleteSource,
// 'elementHook': function (oEl, oItem) {
// if (oEl && oItem)
// {
// oEl.addClass('pgp');
// window.console.log(arguments);
// }
// },
'parseHook': function (aInput) { 'parseHook': function (aInput) {
return _.map(aInput, function (sInputValue) { return _.map(aInput, function (sInputValue) {

View file

@ -55,6 +55,10 @@
&.inputosaurus-selected { &.inputosaurus-selected {
background-color: #ddd; background-color: #ddd;
} }
&.pgp {
background-color: #E5F3E2;
}
} }
.inputosaurus-input { .inputosaurus-input {

View file

@ -751,6 +751,8 @@
this.bSkipNextHide = false; this.bSkipNextHide = false;
this.to.focused(false);
kn.routeOn(); kn.routeOn();
}; };
@ -761,12 +763,14 @@
var self = this; var self = this;
if (!this.oEditor && this.composeEditorArea()) if (!this.oEditor && this.composeEditorArea())
{ {
//_.delay(function () {
self.oEditor = new HtmlEditor(self.composeEditorArea(), null, function () { self.oEditor = new HtmlEditor(self.composeEditorArea(), null, function () {
fOnInit(self.oEditor); fOnInit(self.oEditor);
self.resizerTrigger(); self.resizerTrigger();
}, function (bHtml) { }, function (bHtml) {
self.isHtml(!!bHtml); self.isHtml(!!bHtml);
}); });
//}, 1000);
} }
else if (this.oEditor) else if (this.oEditor)
{ {
@ -1226,6 +1230,10 @@
self.setFocusInPopup(); self.setFocusInPopup();
}); });
} }
else
{
this.setFocusInPopup();
}
aDownloads = this.getAttachmentsDownloadsForUpload(); aDownloads = this.getAttachmentsDownloadsForUpload();
if (Utils.isNonEmptyArray(aDownloads)) if (Utils.isNonEmptyArray(aDownloads))
@ -1276,21 +1284,27 @@
{ {
if (!Globals.bMobileDevice) if (!Globals.bMobileDevice)
{ {
if ('' === this.to()) var self = this;
_.delay(function () {
if ('' === self.to())
{ {
this.to.focused(false); self.to.focused(true);
this.to.focused(true);
} }
else if (this.oEditor) else if (self.oEditor)
{ {
this.oEditor.focus(); if (!self.to.focused())
{
self.oEditor.focus();
} }
} }
}, 100);
}
}; };
ComposePopupView.prototype.onShowWithDelay = function () ComposePopupView.prototype.onShowWithDelay = function ()
{ {
this.setFocusInPopup();
this.resizerTrigger(); this.resizerTrigger();
}; };

View file

@ -64,6 +64,8 @@
// the array of tag names is passed and expected to be returned as an array after manipulation // the array of tag names is passed and expected to be returned as an array after manipulation
parseHook : null, parseHook : null,
elementHook : null,
// define a placeholder to display when the input is empty // define a placeholder to display when the input is empty
placeholder: null placeholder: null
}, },
@ -536,6 +538,8 @@
}); });
} }
$.isFunction(this.options.elementHook) && (this.options.elementHook($li, obj));
return $li; return $li;
} }
}, },

File diff suppressed because one or more lines are too long