Small fixes and code refactoring

This commit is contained in:
RainLoop Team 2015-02-16 01:55:59 +04:00
parent e6c712862d
commit 1a85330770
67 changed files with 413 additions and 181 deletions

View file

@ -138,7 +138,17 @@
return sResult;
};
HtmlEditor.prototype.modeToggle = function (bPlain)
/**
* @param {boolean=} bWrapIsHtml = false
* @param {boolean=} bClearSignatureSigns = false
* @return {string}
*/
HtmlEditor.prototype.getDataWithHtmlMark = function (bWrapIsHtml, bClearSignatureSigns)
{
return (this.isHtml() ? ':HTML:' : '') + this.getData(bWrapIsHtml, bClearSignatureSigns);
};
HtmlEditor.prototype.modeToggle = function (bPlain, bResize)
{
if (this.editor)
{
@ -159,7 +169,22 @@
}
} catch(e) {}
this.resize();
if (bResize)
{
this.resize();
}
}
};
HtmlEditor.prototype.setHtmlOrPlain = function (sText, bFocus)
{
if (':HTML:' === sText.substr(0, 6))
{
this.setHtml(sText.substr(6), bFocus);
}
else
{
this.setPlain(sText, bFocus);
}
};
@ -205,7 +230,7 @@
HtmlEditor.prototype.init = function ()
{
if (this.$element && this.$element[0])
if (this.$element && this.$element[0] && !this.editor)
{
var
self = this,
@ -332,6 +357,16 @@
}
};
HtmlEditor.prototype.setReadOnly = function (bValue)
{
if (this.editor)
{
try {
this.editor.setReadOnly(!!bValue);
} catch (e) {}
}
};
HtmlEditor.prototype.clear = function (bFocus)
{
this.setHtml('', bFocus);

View file

@ -548,6 +548,7 @@
*/
Utils.delegateRun = function (oObject, sMethodName, aParameters, nDelay)
{
// window.console.log('->' + sMethodName); // TODO
if (oObject && oObject[sMethodName])
{
nDelay = Utils.pInt(nDelay);