diff --git a/static/javascript/kdm.js b/static/javascript/kdm.js index 957da87..76048cd 100644 --- a/static/javascript/kdm.js +++ b/static/javascript/kdm.js @@ -200,12 +200,13 @@ eventName: setEvent }); } + $rootScope.$apply(); $(this).dialog("close"); } else { $rootScope.addtimeline.error = true; $rootScope.addtimeline.errormsg = msgs.join(", "); + $rootScope.$apply(); } - $rootScope.$apply(); }, Cancel: function() { $(this).dialog("close"); @@ -323,6 +324,7 @@ scope.$watch('tabs[' + tabIndex + '].population.lost', watchCheckboxArray, true); scope.$watch('tabs[' + tabIndex + '].deathCount', watchCheckboxArray, true); scope.$watch('tabs[' + tabIndex + '].timeline', watchCheckboxArray, true); + scope.$watch('tabs[' + tabIndex + '].principles', watchPrinciples, true); } } @@ -356,6 +358,22 @@ } } + function watchPrinciples(newVal, oldVal) { + if (newVal !== oldVal) { + var newCur; + var oldCur; + for (var i = 0; i < newVal.length; i++) { + newCur = newVal[i]; + oldCur = oldVal[i]; + if (newCur.choiceleft && oldCur.choiceright) { + newCur.choiceright = false; + } else if (newCur.choiceright && oldCur.choiceleft) { + newCur.choiceleft = false; + } + } + } + } + function deleteTab($rootScope, tabid) { var tabs = $rootScope.tabs; var index = -1; diff --git a/static/templates/settlement/principles.html b/static/templates/settlement/principles.html index 851bbae..25d96fd 100644 --- a/static/templates/settlement/principles.html +++ b/static/templates/settlement/principles.html @@ -11,7 +11,7 @@
- +
@@ -20,7 +20,7 @@ or
- +