mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
Merge pull request #2559 from tm-linkwerk/fix-2556-attributemanager
fixes #2556 error toggling line attribute; clarified documentation
This commit is contained in:
commit
f2e5dce6fa
1 changed files with 7 additions and 5 deletions
|
@ -189,13 +189,15 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Sets a specified attribute on a line
|
Toggles a line attribute for the specified line number
|
||||||
@param lineNum: the number of the line to set the attribute for
|
If a line attribute with the specified name exists with any value it will be removed
|
||||||
@param attributeKey: the name of the attribute to set, e.g. list
|
Otherwise it will be set to the given value
|
||||||
@param attributeValue: an optional parameter to pass to the attribute (e.g. indention level)
|
@param lineNum: the number of the line to toggle the attribute for
|
||||||
|
@param attributeKey: the name of the attribute to toggle, e.g. list
|
||||||
|
@param attributeValue: the value to pass to the attribute (e.g. indention level)
|
||||||
*/
|
*/
|
||||||
toggleAttributeOnLine: function(lineNum, attributeName, attributeValue) {
|
toggleAttributeOnLine: function(lineNum, attributeName, attributeValue) {
|
||||||
return this.getAttributeOnLine(attributeName) ?
|
return this.getAttributeOnLine(lineNum, attributeName) ?
|
||||||
this.removeAttributeOnLine(lineNum, attributeName) :
|
this.removeAttributeOnLine(lineNum, attributeName) :
|
||||||
this.setAttributeOnLine(lineNum, attributeName, attributeValue);
|
this.setAttributeOnLine(lineNum, attributeName, attributeValue);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue