mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 15:23:29 -05:00
Add commands for setting text/background colour.
This commit is contained in:
parent
b3d9de6e86
commit
d01cc9875f
1 changed files with 31 additions and 0 deletions
|
@ -1491,6 +1491,37 @@ document.addEventListener( 'DOMContentLoaded', function () {
|
||||||
focus();
|
focus();
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setTextColour: function ( colour ) {
|
||||||
|
changeFormat({
|
||||||
|
tag: 'SPAN',
|
||||||
|
attributes: {
|
||||||
|
'class': 'colour',
|
||||||
|
style: 'color: ' + colour
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
tag: 'SPAN',
|
||||||
|
attributes: { 'class': 'colour' }
|
||||||
|
});
|
||||||
|
focus();
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
setHighlightColour: function ( colour ) {
|
||||||
|
changeFormat({
|
||||||
|
tag: 'SPAN',
|
||||||
|
attributes: {
|
||||||
|
'class': 'highlight',
|
||||||
|
style: 'background-color: ' + colour
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
tag: 'SPAN',
|
||||||
|
attributes: { 'class': 'highlight' }
|
||||||
|
});
|
||||||
|
focus();
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
setTextAlignment: function ( dir ) {
|
setTextAlignment: function ( dir ) {
|
||||||
forEachBlock( function ( block ) {
|
forEachBlock( function ( block ) {
|
||||||
block.className = 'align-' + dir;
|
block.className = 'align-' + dir;
|
||||||
|
|
Loading…
Reference in a new issue