changeset 72:6974309983d1 extractapp

Bug fixed:1.remove tagging popup window on editable-area, 2.close/disable inputs and buttons, when entering edit-text mode.
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 08 Apr 2015 15:45:53 +0200
parents 26d8c4c43d86
children 2daef8e36214
files js/taggingtext.js views/Extractapp/TaggingText.php
diffstat 2 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/js/taggingtext.js	Wed Apr 08 14:57:01 2015 +0200
+++ b/js/taggingtext.js	Wed Apr 08 15:45:53 2015 +0200
@@ -188,16 +188,28 @@
 function editText() {
     var el = document.getElementById("editable-area");
     if ( $("#editTextId").html() == "Edit the text" ) {
+        // --- in editing mode ---
         saveUndoText();
         el.contentEditable = true;
+
+        // disable/close functions
         $("button").attr("disabled", true);
         $("#editTextId").attr("disabled", false);
+        $("#popups").css("display","none"); // close the popup windows
+        $("input").attr('disabled', true); // disable input
+        // clean editable-area
+        $('.questionMarkClass').remove();
+        $('.tagItemDivClass').remove();
+        
         $("#editTextId").html("Edit completed!");
     } else {
+        // --- not editing mode ---
         el.contentEditable = false;
         cleanUpTextArea();
         $("button").attr("disabled", false);
-        $("#editTextId").html("Edit the text");
+        $("#popups").css("display","block"); // open the popup windows
+        $("input").attr('disabled', false); // enable input
+        $("#editTextId").html("Edit the text"); 
     }
 }
 
--- a/views/Extractapp/TaggingText.php	Wed Apr 08 14:57:01 2015 +0200
+++ b/views/Extractapp/TaggingText.php	Wed Apr 08 15:45:53 2015 +0200
@@ -208,7 +208,7 @@
         alert("Warning: taglist is deprecated in the current file.");
 
     }
-   
+
 
 });
 
@@ -543,7 +543,7 @@
     // clean editable-area
     $('.questionMarkClass').remove();
     $('.tagItemDivClass').remove();
-    
+ 
     // -------------
     var info = JSON.parse('<?php echo json_encode($info) ?>');
     var topic_id = JSON.parse('<?php echo json_encode($default_topic_id) ?>');