Prevented user-created dependency loops when setting effects as calclations
This commit is contained in:
@@ -24,7 +24,7 @@ evaluate = function(charId, string){
|
||||
} catch(e){
|
||||
console.log(e)
|
||||
return string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//takes a string with {calculations} and returns it with the results
|
||||
|
||||
18
rpg-docs/lib/functions/placeCaretAtEnd.js
Normal file
18
rpg-docs/lib/functions/placeCaretAtEnd.js
Normal file
@@ -0,0 +1,18 @@
|
||||
placeCaretAtEnd = function(el) {
|
||||
el = el.get(0); //jquery element -> DOM element
|
||||
el.focus();
|
||||
if (typeof window.getSelection != "undefined"
|
||||
&& typeof document.createRange != "undefined") {
|
||||
var range = document.createRange();
|
||||
range.selectNodeContents(el);
|
||||
range.collapse(false);
|
||||
var sel = window.getSelection();
|
||||
sel.removeAllRanges();
|
||||
sel.addRange(range);
|
||||
} else if (typeof document.body.createTextRange != "undefined") {
|
||||
var textRange = document.body.createTextRange();
|
||||
textRange.moveToElementText(el);
|
||||
textRange.collapse(false);
|
||||
textRange.select();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user