Skip to content

Commit a01b0b1

Browse files
committedOct 29, 2016
fix tags duplicates and bugs
1 parent e13d65f commit a01b0b1

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed
 

‎speak2me/css/styles.css

+4
Original file line numberDiff line numberDiff line change
@@ -753,4 +753,8 @@ height:220px;
753753
width:220px;
754754

755755

756+
}
757+
758+
.fa-tags {
759+
margin-right: 5px;
756760
}

‎speak2me/index2.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ <h2>Select tags to add</h2>
445445
<div class ="button secondary expanded tag-image-text">Sports</div>
446446
</div>
447447
<div class="column large-4 " style = "background-image: url(images/bussiness.jpg)">
448-
<div class ="button secondary expanded tag-image-text">Bussiness</div>
448+
<div class ="button secondary expanded tag-image-text">Business</div>
449449
</div>
450450
</div>
451451
<div class ="row expanded">

‎speak2me/js/webpage.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,19 @@ $(".tags-menu .tag-image-text").click(function(){
7979
$(".tags-menu button").click(function(){
8080
$(".tags-menu .column").each(function(){
8181
if($(this).hasClass("tag-selected")){
82-
var tag = $(this).text();
83-
$(".account-details p:contains('Preferred tags') .tag:last-of-type .fa").parent().after(
82+
var tag = $(this).text().replace(/\s+/g, " ");
83+
var add = 1;
84+
$(".account-details .tag").not(".tag-reputation").each(function(){
85+
var otherTag = $(this).text().replace(/\s+/g, " ");
86+
var more = " " + otherTag;
87+
if(tag == more){
88+
add = 0;
89+
}
90+
});
91+
if(add){
92+
$(".account-details p:contains('Preferred tags') .fa-tags").after(
8493
$("<span class='tag'>"+ tag +" <span class='fa fa-times-circle created-tag'></span></span>"));
94+
}
8595
}
8696
});
8797
closeTagMenu();

0 commit comments

Comments
 (0)
Please sign in to comment.