]> dev.renevier.net Git - syj.git/blobdiff - public/js/syj.js
do not enable submitting a duplicate path without first modifying it
[syj.git] / public / js / syj.js
index 923e93dc2b1896cf553ac428484978471065edf0..0572fce71c7099bcad3f054c04690bf43d194803 100644 (file)
@@ -40,6 +40,7 @@ var SyjSaveUI = {
 
     enableSubmit: function() {
         $("geom_submit").disabled = false;
+        $("geom_accept").disabled = false;
         this.status = "partial";
         return this;
     },
@@ -47,6 +48,8 @@ var SyjSaveUI = {
     disableSubmit: function() {
         $("geom_submit").blur();
         $("geom_submit").disabled = true;
+        $("geom_accept").blur();
+        $("geom_accept").disabled = true;
         this.status = "partial";
         return this;
     }
@@ -258,7 +261,6 @@ var SYJView = {
                 this.messenger.hide();
                 this.editMode();
                 this.mode = 'create';
-                SyjSaveUI.enableSubmit();
             }.bind(this));
         }
 
@@ -597,13 +599,15 @@ var SYJUserClass = Class.create(SYJModalClass, {
 
         $$("#user_termsofuse_anchor, #geom_termsofuse_anchor").invoke('observe', "click", function(evt) {
             if (!this.toubox) {
-                $("termsofusearea").show();
-                $("termsofuseiframe").setAttribute("src", evt.target.href);
                 this.toubox = new SimpleBox($("termsofusearea"), {
                     closeMethods: ["onescapekey", "onouterclick", "onbutton"]
                 });
             }
             this.toubox.show();
+            if (!$("termsofuseiframe").getAttribute("src")) {
+                $("termsofusearea").show();
+                $("termsofuseiframe").setAttribute("src", evt.target.href);
+            }
             evt.stop();
         }.bindAsEventListener(this));