Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

generalize 'chiclet' style.

focus on 'add association' text field after clicking 'add...'
  • Loading branch information...
commit 1590bc637b5026a1fedd0ee1e61ca0e9bca0c2e9 1 parent 6c50cf5
@dguzzo authored
View
31 app/assets/stylesheets/main.scss
@@ -586,21 +586,24 @@ $singleItemPaddingBottom: 15px;
}
}
+.chiclet{
+ background: #6A83AF;
+ float: left;
+ padding: 4px 8px 5px;
+ a{color: white;}
+ @include borderRadius(12px);
+}
+
.tagList{
$line-height: 28px;
-
h4, .addTag{line-height: $line-height;}
-
$paddingAnim: 4px;
.tag{
- margin-left: 10px;
- margin-bottom: 6px;
- background: #6A83AF;
- float: left;
- padding: 5px 7px;
- @include borderRadius(12px);
+
+ @extend .chiclet;
+
// @include css3(transition-property, padding margin);
// @include css3(transition-duration, 0.1s);
//***
@@ -821,13 +824,23 @@ input#tag_name{
}
.removeAssociatedWord{
+ margin-left: 3px;
&:hover{cursor:pointer; color: black;}
}
.associatedWordsList{
margin-left: 10px;
margin-right: 10px;
- li{float: left; margin-right: 10px;}
+ li{
+ float: left;
+ margin: 0 10px 10px 0;
+ }
+}
+
+.associatedWord{
+ @extend .chiclet;
+ padding-right: 10px;
+ line-height: 1.3em;
}
.associatedWordsWrapper{
View
4 app/controllers/words_controller.rb
@@ -341,7 +341,7 @@ def add_association
source_word = Word.find(params["source_word_id"])
destination_word = Word.find(params["destination_word_id"])
source_word.parents << destination_word
- VocabUtil::colored_log("added '#{destination_word.name}' to '#{source_word.name}'")
+ # VocabUtil::colored_log("added '#{destination_word.name}' to '#{source_word.name}'")
render :layout => nil, :partial => "partials/word_association_item", :locals => { :word => destination_word }
end
@@ -349,7 +349,7 @@ def delete_association
source_word = Word.find(params["source_word_id"])
destination_word = Word.find(params["destination_word_id"])
source_word.parents.delete(destination_word)
- VocabUtil::colored_log("removed '#{destination_word.name}' from '#{source_word.name}'")
+ # VocabUtil::colored_log("removed '#{destination_word.name}' from '#{source_word.name}'")
render :nothing => true
end
View
5 app/views/partials/_word_association_item.html.haml
@@ -1,3 +1,4 @@
%li
- %span.associatedWord= link_to "#{word.name}", word_path(word)
- %span.removeAssociatedWord{"data-word-id" => word.id} x
+ %span.associatedWord
+ = link_to "#{word.name}", word_path(word)
+ %span.removeAssociatedWord{"data-word-id" => word.id} x
View
BIN  db/development.sqlite3
Binary file not shown
View
1  public/javascripts/application.js
@@ -69,6 +69,7 @@ function setupAssociationBehavior(){
event.preventDefault();
jQuery(this).hide();
jQuery('.cancelAssociation, #addAssociationField').show();
+ jQuery('#addAssociationField').focus();
});
jQuery('.cancelAssociation').click( function(event){
View
41 public/stylesheets/main.css
@@ -538,24 +538,25 @@ label {
.listItem:last-child:after {
content: ''; }
-.tagList h4, .tagList .addTag {
- line-height: 28px; }
-.tagList .tag {
- margin-left: 10px;
- margin-bottom: 6px;
+.chiclet, .tagList .tag, .associatedWord {
background: #6A83AF;
float: left;
- padding: 5px 7px;
+ padding: 4px 8px 5px;
-moz-border-radius: 12px;
-webkit-border-radius: 12px;
border-radius: 12px; }
- .tagList .tag a {
- color: rgba(255, 255, 255, 0.9); }
- .tagList .tag a:hover {
- text-decoration: none; }
- .tagList .tag:hover {
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
- background: #8b9fc1; }
+ .chiclet a, .tagList .tag a, .associatedWord a {
+ color: white; }
+
+.tagList h4, .tagList .addTag {
+ line-height: 28px; }
+.tagList .tag a {
+ color: rgba(255, 255, 255, 0.9); }
+ .tagList .tag a:hover {
+ text-decoration: none; }
+.tagList .tag:hover {
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
+ background: #8b9fc1; }
#todo {
position: fixed;
@@ -758,16 +759,22 @@ input#tag_name {
.cancelAssociation {
margin-left: 4px; }
-.removeAssociatedWord:hover {
- cursor: pointer;
- color: black; }
+.removeAssociatedWord {
+ margin-left: 3px; }
+ .removeAssociatedWord:hover {
+ cursor: pointer;
+ color: black; }
.associatedWordsList {
margin-left: 10px;
margin-right: 10px; }
.associatedWordsList li {
float: left;
- margin-right: 10px; }
+ margin: 0 10px 10px 0; }
+
+.associatedWord {
+ padding-right: 10px;
+ line-height: 1.3em; }
.associatedWordsWrapper {
margin: 8px 0 6px 0; }
Please sign in to comment.
Something went wrong with that request. Please try again.