|
@@ -526,6 +526,9 @@ $(document).ready(function() {
|
|
|
|
|
|
// For every added item
|
|
// For every added item
|
|
$("li.added_item .expandable").each(function() {
|
|
$("li.added_item .expandable").each(function() {
|
|
|
|
+ $(this).html($(this).text());
|
|
|
|
+
|
|
|
|
+ /*
|
|
var thisDiv = $(this); // Delete the declaration (because it's ugly!)
|
|
var thisDiv = $(this); // Delete the declaration (because it's ugly!)
|
|
|
|
|
|
// For every tag in the database that belongs to the active user
|
|
// For every tag in the database that belongs to the active user
|
|
@@ -540,10 +543,11 @@ $(document).ready(function() {
|
|
|
|
|
|
loopCounter++;
|
|
loopCounter++;
|
|
}
|
|
}
|
|
|
|
+ */
|
|
});
|
|
});
|
|
|
|
|
|
// If no tags have been added, reset text explaining so
|
|
// If no tags have been added, reset text explaining so
|
|
- if(tags.length === 0 || tags === undefined) {
|
|
|
|
|
|
+ if(tags.length === 0) {
|
|
$("div.saved-tags p").html("You haven't added any tags yet.");
|
|
$("div.saved-tags p").html("You haven't added any tags yet.");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -579,7 +583,7 @@ $(document).ready(function() {
|
|
console.log(tags.length);
|
|
console.log(tags.length);
|
|
|
|
|
|
// If no tags have been added, reset text explaining so
|
|
// If no tags have been added, reset text explaining so
|
|
- if(tags.length === 0 || tags === undefined) {
|
|
|
|
|
|
+ if(tags.length === 0) {
|
|
$("div.saved-tags p").html("You haven't added any tags yet.");
|
|
$("div.saved-tags p").html("You haven't added any tags yet.");
|
|
}
|
|
}
|
|
*/
|
|
*/
|
|
@@ -692,11 +696,11 @@ $(document).ready(function() {
|
|
// var textarea = $("div#tag-window textarea#tag-description");
|
|
// var textarea = $("div#tag-window textarea#tag-description");
|
|
var textareaHasBeenChanged = false;
|
|
var textareaHasBeenChanged = false;
|
|
var tag;
|
|
var tag;
|
|
- var tagIsNew = false;
|
|
|
|
|
|
+ // var tagIsNew = false;
|
|
var username = $("input[name='username']").val();
|
|
var username = $("input[name='username']").val();
|
|
|
|
|
|
// Check if the tag is new
|
|
// Check if the tag is new
|
|
- function checkIfTagIsNew() {
|
|
|
|
|
|
+ function hideDeleteTagIfTagIsNew() {
|
|
// Declarations
|
|
// Declarations
|
|
var tagToAJAX = tag;
|
|
var tagToAJAX = tag;
|
|
|
|
|
|
@@ -717,10 +721,10 @@ $(document).ready(function() {
|
|
$("div#tag-window button#delete-tag").css("display", "none");
|
|
$("div#tag-window button#delete-tag").css("display", "none");
|
|
|
|
|
|
// Hide "Similar tags"
|
|
// Hide "Similar tags"
|
|
- $("div#tag-window h2.similar-tags").css("display", "none");
|
|
|
|
|
|
+ // $("div#tag-window h2.similar-tags").css("display", "none");
|
|
|
|
|
|
// The tag is new
|
|
// The tag is new
|
|
- tagIsNew = true;
|
|
|
|
|
|
+ // tagIsNew = true;
|
|
}
|
|
}
|
|
// If the current tag exists in the database
|
|
// If the current tag exists in the database
|
|
else {
|
|
else {
|
|
@@ -728,7 +732,7 @@ $(document).ready(function() {
|
|
$("div#tag-window button#delete-tag").css("display", "inline");
|
|
$("div#tag-window button#delete-tag").css("display", "inline");
|
|
|
|
|
|
// Show "Similar tags"
|
|
// Show "Similar tags"
|
|
- $("div#tag-window h2.similar-tags").css("display", "block");
|
|
|
|
|
|
+ // $("div#tag-window h2.similar-tags").css("display", "block");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
error: function(xhr) {
|
|
error: function(xhr) {
|
|
@@ -840,11 +844,8 @@ $(document).ready(function() {
|
|
// updateTags();
|
|
// updateTags();
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- // If the tag isn't a new tag
|
|
|
|
- if(tagIsNew === false) {
|
|
|
|
- // Show the message saying that there are no similar tags to show
|
|
|
|
- $("p.similar-tags-description-none").css("display", "block");
|
|
|
|
- }
|
|
|
|
|
|
+ // Show the message saying that there are no similar tags to show
|
|
|
|
+ $("p.similar-tags-description-none").css("display", "block");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
error: function(xhr) {
|
|
error: function(xhr) {
|
|
@@ -879,7 +880,7 @@ $(document).ready(function() {
|
|
*/
|
|
*/
|
|
|
|
|
|
// Check if the tag is new
|
|
// Check if the tag is new
|
|
- checkIfTagIsNew();
|
|
|
|
|
|
+ hideDeleteTagIfTagIsNew();
|
|
|
|
|
|
// Get the description for the selected tag
|
|
// Get the description for the selected tag
|
|
getDescriptionForSelectedTag();
|
|
getDescriptionForSelectedTag();
|
|
@@ -938,7 +939,7 @@ $(document).ready(function() {
|
|
closeTagWindow();
|
|
closeTagWindow();
|
|
}
|
|
}
|
|
|
|
|
|
- tagIsNew = false;
|
|
|
|
|
|
+ // tagIsNew = false;
|
|
});
|
|
});
|
|
|
|
|
|
// If the user clicks on the "Close" button
|
|
// If the user clicks on the "Close" button
|
|
@@ -1097,6 +1098,11 @@ $(document).ready(function() {
|
|
textElement.css("-webkit-transform", "scale(1)");
|
|
textElement.css("-webkit-transform", "scale(1)");
|
|
textElement.css("transform", "scale(1)");
|
|
textElement.css("transform", "scale(1)");
|
|
|
|
|
|
|
|
+ // If no tags have been added, reset text explaining so
|
|
|
|
+ if(tags.length === 0) {
|
|
|
|
+ $("div.saved-tags p").html("You haven't added any tags yet.");
|
|
|
|
+ }
|
|
|
|
+
|
|
toggleTextElementOnFocus();
|
|
toggleTextElementOnFocus();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -1112,7 +1118,7 @@ $(document).ready(function() {
|
|
if(tagWindowIsOpen === false) {
|
|
if(tagWindowIsOpen === false) {
|
|
var li = $(this).parent();
|
|
var li = $(this).parent();
|
|
var textElement;
|
|
var textElement;
|
|
- var textElementHTML;
|
|
|
|
|
|
+ // var textElementHTML;
|
|
var textElementWidth;
|
|
var textElementWidth;
|
|
|
|
|
|
// Replace div with a textarea
|
|
// Replace div with a textarea
|
|
@@ -1123,6 +1129,7 @@ $(document).ready(function() {
|
|
// Remember the text element
|
|
// Remember the text element
|
|
textElement = li.find(".expandable");
|
|
textElement = li.find(".expandable");
|
|
|
|
|
|
|
|
+ /*
|
|
// Fix the bug that tags still might appear
|
|
// Fix the bug that tags still might appear
|
|
textElementHTML = textElement.html();
|
|
textElementHTML = textElement.html();
|
|
|
|
|
|
@@ -1132,6 +1139,7 @@ $(document).ready(function() {
|
|
}
|
|
}
|
|
|
|
|
|
textElement.html(textElementHTML);
|
|
textElement.html(textElementHTML);
|
|
|
|
+ */
|
|
|
|
|
|
// Remember the width of the text element
|
|
// Remember the width of the text element
|
|
textElementWidth = textElement.width();
|
|
textElementWidth = textElement.width();
|