Skip to content
Snippets Groups Projects
Commit f0469911 authored by vas's avatar vas
Browse files

move properTitle to global scope

parent 577474b7
No related branches found
No related tags found
2 merge requests!2176Pregmod master ra rework,!2047RA rework
...@@ -224,3 +224,11 @@ window.isLeaderP = function isLeaderP(slave) { ...@@ -224,3 +224,11 @@ window.isLeaderP = function isLeaderP(slave) {
} }
return false return false
}; };
// helper function returning PC's title
window.properTitle = function properTitle() {
const PC = State.variables.PC
if (PC.customTitle) return PC.customTitle;
else if (V.PC.title !== 0) return "Sir";
else return "Ma'am";
};
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// uses an object-oriented widget pattern // uses an object-oriented widget pattern
// wrapped in a closure so as not to polute the global namespace // wrapped in a closure so as not to polute the global namespace
// the widgets are generic enough to be reusable; if similar user interfaces are ported to JS, we could move the classes to the global scope // the widgets are generic enough to be reusable; if similar user interfaces are ported to JS, we could move the classes to the global scope
j
window.rulesAssistantOptions = (function() { window.rulesAssistantOptions = (function() {
"use strict" "use strict"
...@@ -26,13 +26,6 @@ window.rulesAssistantOptions = (function() { ...@@ -26,13 +26,6 @@ window.rulesAssistantOptions = (function() {
root.appendChild(new Element(tmp)) root.appendChild(new Element(tmp))
} }
// helper function returning PC's title
function properTitle() {
if (V.PC.customTitle) return V.PC.customTitle
else if (V.PC.title !== 0) return "Sir"
else return "Ma'am"
}
// the Element class wraps around a DOM element and adds extra functionality // the Element class wraps around a DOM element and adds extra functionality
// this is safer than extending DOM objects directly // this is safer than extending DOM objects directly
// it also turns DOM manipulation into an implementation detail // it also turns DOM manipulation into an implementation detail
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment