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);
};
module.exports = HtmlEditor;
}());

9
dev/External/ko.js vendored
View file

@ -131,7 +131,7 @@
if (Globals && Globals.aBootstrapDropdowns)
{
Globals.aBootstrapDropdowns.push($(oElement));
$(oElement).click(function () {
require('Common/Utils').detectDropdownVisibility();
});
@ -688,6 +688,13 @@
'focusCallback': fFocusCallback,
'inputDelimiters': [',', ';'],
'autoCompleteSource': fAutoCompleteSource,
// 'elementHook': function (oEl, oItem) {
// if (oEl && oItem)
// {
// oEl.addClass('pgp');
// window.console.log(arguments);
// }
// },
'parseHook': function (aInput) {
return _.map(aInput, function (sInputValue) {

View file

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

View file

@ -751,6 +751,8 @@
this.bSkipNextHide = false;
this.to.focused(false);
kn.routeOn();
};
@ -761,12 +763,14 @@
var self = this;
if (!this.oEditor && this.composeEditorArea())
{
//_.delay(function () {
self.oEditor = new HtmlEditor(self.composeEditorArea(), null, function () {
fOnInit(self.oEditor);
self.resizerTrigger();
}, function (bHtml) {
self.isHtml(!!bHtml);
});
//}, 1000);
}
else if (this.oEditor)
{
@ -1226,6 +1230,10 @@
self.setFocusInPopup();
});
}
else
{
this.setFocusInPopup();
}
aDownloads = this.getAttachmentsDownloadsForUpload();
if (Utils.isNonEmptyArray(aDownloads))
@ -1276,21 +1284,27 @@
{
if (!Globals.bMobileDevice)
{
if ('' === this.to())
{
this.to.focused(false);
this.to.focused(true);
}
else if (this.oEditor)
{
this.oEditor.focus();
}
var self = this;
_.delay(function () {
if ('' === self.to())
{
self.to.focused(true);
}
else if (self.oEditor)
{
if (!self.to.focused())
{
self.oEditor.focus();
}
}
}, 100);
}
};
ComposePopupView.prototype.onShowWithDelay = function ()
{
this.setFocusInPopup();
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
parseHook : null,
elementHook : null,
// define a placeholder to display when the input is empty
placeholder: null
},
@ -536,6 +538,8 @@
});
}
$.isFunction(this.options.elementHook) && (this.options.elementHook($li, obj));
return $li;
}
},

File diff suppressed because one or more lines are too long